techartorg / MXSPyCOM

A modern version of MXSCOM, to allow for editing & execution of 3ds Max MaxScript and Python files from external code editors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When trying to report an error, some undefined functions appear

a690089735 opened this issue · comments

The error message displayed:
-- Error occurred in anonymous codeblock
-- Frame:
-- cs: StringStream:"** thread data: threadID:17396
** ------------------------------------------------------
** [stack level: 0]
** In anonymous codeblock
-- Locals:
-- cs: StringStream:""
-- getErrorSourceFileOffset: undefined
-- getErrorSourceFileLine: undefined
-- Externals:
-- getErrorSourceFileName: Global:getErrorSourceFileName : undefined
** ------------------------------------------------------
** [stack level: 1]
** called from top-level
"
-- getErrorSourceFileOffset: undefined
-- getErrorSourceFileLine: undefined
-- Error occurred during fileIn in StringStream:"try(filein(@"e:\我的坚果云\max脚本\vscode_test\test.ms")) catch(cs = "" as stringStream;stack to:cs;(for i in #("Error;" + " filename: " + (getErrorSourceFileName() as string) + "; position: " + ((getErrorSourceFileOffset() as integer) as string) + "; line: " + ((getErrorSourceFileLine() as integer) as string) + "
" + "callstack:
" + (cs as string)) + (filterString (getCurrentException()) "
") do setListenerSelText ("
" + i)));setListenerSelText "
""; line number: 1
-- Type error: Call needs function or class, got: undefined
during OLE automation function call

my maxscript:

-- fn do_hello =
-- (
--     print"hello!!"
-- )
-- do_hello()

getnodebyname dem --test error

3dmaxver:2014

Your script has an error in it. getnodebyname() takes a string as the first argument. You are passing it an undefined variable.
MXSPyCOM.

MXSPyCOM works by reading the user's script as a string and calling execute() on that string. If there are errors in the user's script MaxScript will determine that the error is at the point the "execute()" call is made. It would be extremely difficult, probably impossible, to get the callstack to only show the errors in the user's script, not both it and the wrapper script that runs it.

Your script has an error in it. getnodebyname() takes a string as the first argument. You are passing it an undefined variable. MXSPyCOM.

MXSPyCOM works by reading the user's script as a string and calling execute() on that string. If there are errors in the user's script MaxScript will determine that the error is at the point the "execute()" call is made. It would be extremely difficult, probably impossible, to get the callstack to only show the errors in the user's script, not both it and the wrapper script that runs it.

Yes, I wrote this error on purpose, for see what the error message would look like.
What caught my attention was that
getErrorSourceFileOffset : undefined
getErrorSourceFileLine : undefined
getErrorSourceFileName : undefined

These three functions seem to try to parse the error message, but they are not defined.
Does this look like part of mxspycom?
@JeffHanna