PDA

View Full Version : cropped Error Message


PixelBaker
02-03-2011, 02:58 PM
Hi everyone.

Here is the situation:
I get some pretty big error messages raised by Python and moved with the help of a COM server over to MaxScript. The error message gets cropped, when using GetCurrentException() or caused inside a rollout. Anyone knows a solution for that issue?
Here comes some example code for you:


msg = "-- Runtime error: OLEObject method call failed: \
Error Message 1: Unexpected Python Error: Traceback (most recent call last): \
File \"C:\Python26\lib\site-packages\win32com\server\policy.py\", line 277, in _Invoke_ \
return self._invoke_(dispid, lcid, wFlags, args) \
File \"C:\Python26\lib\site-packages\win32com\server\policy.py\", line 282, in _invoke_ \
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None) \
File \"C:\Python26\lib\site-packages\win32com\server\policy.py\", line 585, in _invokeex_ \
return func(*args) \
File \"K:\source\Application\System\dd\distributor\manager.py\", line 111, in RunTask \
manager.runTask(taskName, file, mode, user, quiet, extraValues) \
File \"K:\source\Application\System\dd\distributor\manager.py\", line 62, in runTask \
jobs = task.createJobs() \
File \"K:\source\Application\System\dd\distributor\tasks.py\", line 383, in createJobs \
return [os.path.expandvars(str(jobOn)) for jobOn in jobsCopy] \
File \"K:\source\Application\System\dd\distributor\tasks.py\", line 47, in __repr__ \
return \"%s%s\" % (self.exe, self._cat()) \
File \"K:\source\Application\System\dd\distributor\tasks.py\", line 56, in _cat \
str += self._renderArg(argOn) \
File \"K:\source\Application\System\dd\distributor\tasks.py\", line 126, in _renderArg \
str += \":\" + self._renderElem(arg[\"value\"]) \
File \"K:\source\Application\System\dd\distributor\tasks.py\", line 137, in _renderElem \
return \"%s\" % (elem) \
File \"K:\source\Application\System\dd\distributor\types.py\", line 271, in __repr__ \
raise TypeExtraValueNAN(e) \
TypeExtraValueNAN: An extra value holds the value '%s', which is not a number."

-- 1.
"\n1."
throw msg

-- 2.
"\n2."
try (
throw msg
)
catch(
GetCurrentException()
)

-- 3.
"\n3."
rollout test "was"
(
on test open do
(
throw msg
)
)
CreateDialog test


And here are the results:

1.
-- Error occurred in anonymous codeblock; filename: K:\source\Development\Max\Structs\cfLog\; position: 1831; line: 29
-- Runtime error: -- Runtime error: OLEObject method call failed: \
Error Message 1: Unexpected Python Error: Traceback (most recent call last): \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 277, in _Invoke_ \
return self._invoke_(dispid, lcid, wFlags, args) \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 282, in _invoke_ \
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None) \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 585, in _invokeex_ \
return func(*args) \
File "K:\source\Application\System\dd\distributor\manager.py", line 111, in RunTask \
manager.runTask(taskName, file, mode, user, quiet, extraValues) \
File "K:\source\Application\System\dd\distributor\manager.py", line 62, in runTask \
jobs = task.createJobs() \
File "K:\source\Application\System\dd\distributor asks.py", line 383, in createJobs \
return [os.path.expandvars(str(jobOn)) for jobOn in jobsCopy] \
File "K:\source\Application\System\dd\distributor asks.py", line 47, in __repr__ \
return "%s%s" % (self.exe, self._cat()) \
File "K:\source\Application\System\dd\distributor asks.py", line 56, in _cat \
str += self._renderArg(argOn) \
File "K:\source\Application\System\dd\distributor asks.py", line 126, in _renderArg \
str += ":" + self._renderElem(arg["value"]) \
File "K:\source\Application\System\dd\distributor asks.py", line 137, in _renderElem \
return "%s" % (elem) \
File "K:\source\Application\System\dd\distributor ypes.py", line 271, in __repr__ \
raise TypeExtraValueNAN(e) \
TypeExtraValueNAN: An extra value holds the value '%s', which is not a number.

2.
"-- Runtime error: -- Runtime error: OLEObject method call failed: \
Error Message 1: Unexpected Python Error: Traceback (most recent call last): \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 277, in _Invoke_ \
return self._invoke_(dispid, lcid, wFlags, args) \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 282, in _invoke_ \
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None) \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 585, in _invokeex_ \
return func(*args) \
File "K:\source\Application\System\dd\distributor\manager.py", line 111, in RunTask \
manager.runTask(taskName, file, mode, user, quiet, extraValues) \
File "K:\source\Application\System\dd\distributor\manager.py", line 62, in runTask \
jobs = task.createJobs() \
File "K:\source\Application\System\dd\distributor asks.py", line 383, in createJobs \
return [os.path.expandvars(str(jobOn)) for jobOn in jobsCop*█"

3.
Rollout:test
-- Error occurred in test.open(); filename: K:\source\Development\Max\Structs\cfLog\; position: 1980; line: 46
-- Frame:
>> MAXScript Rollout Handler Exception: -- Runtime error: -- Runtime error: OLEObject method call failed: \
Error Message 1: Unexpected Python Error: Traceback (most recent call last): \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 277, in _Invoke_ \
return self._invoke_(dispid, lcid, wFlags, args) \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 282, in _invoke_ \
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None) \
File "C:\Python26\lib\site-packages\win32com\server\policy.py", line 585, in _invokeex_ \
return func(*args) \
File "K:\source\Application\System\dd\distributor\manager.py", line 111, in RunTask \
manager.runTask(taskName, file, mode, user, quiet, extraValues) \
File "K:\source\Application\System\dd\distributor\manager.py", line 62, in runTask \
jobs = task.createJobs() \
File "K:\source\Application\System\dd\distributor asks.py", line 383, in createJobs \
return [os.path.expandvars(str(jobOn)) for jobOn in jobsCop└Î <<


Only the first case works. What do you think? Any possibility to get the full error for case 2 and 3?

Thanks a lot,
Pixelbaker

CGTalk Moderation
02-03-2011, 02:58 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.