Hi All,
Has anyone had any success with overriding Houdini's python sys.excepthook?
I'm using it for automated error reporting for our pipeline scripts.
houdini doesn't object if i pass sys.exepthook a custom function, but it never gets called.
cheers,
chrisg
overriding sys.excepthook
4132 4 2- doctorbob
- Member
- 30 posts
- Joined:
- Offline
- Loqy0815
- Member
- 3 posts
- Joined: Nov. 2016
- Offline
Hi there,
having the same issue here.
We would like to use Raven/Sentry for Error-Logging (https://github.com/getsentry/raven-python) [github.com]
which is build around sys.excepthook
basically:
in any “normal” python-shell this just prints
in the houdini-python-shell I still get the usual Traceback
is this expected? Am I'm missing something here?
cheers
Loqy
having the same issue here.
We would like to use Raven/Sentry for Error-Logging (https://github.com/getsentry/raven-python) [github.com]
which is build around sys.excepthook
basically:
def handle_exception(exc_type, exc_value, exc_traceback): print "there was a issue" sys.excepthook = handle_exception print 1 / 0
in any “normal” python-shell this just prints
"there was a issue".
Traceback (most recent call last): File "<console>", line 1, in <module> ZeroDivisionError: integer division or modulo by zero
cheers
Loqy
Edited by Loqy0815 - Nov. 22, 2016 07:39:40
- doctorbob
- Member
- 30 posts
- Joined:
- Offline
Loqy,
the last comms i had with sidefx about this was:
in summary, you can override excepthook in the python shell window, but not shelf tools.
cheers,
chrisg
the last comms i had with sidefx about this was:
I was told that Houdini's Python shell (in the GUI) uses Python's code.InteractiveInterpreter class which, for whatever reason, doesn't use sys.excepthook. The following code will change it to use sys.excepthook:
import sys
import houdiniInterpreter
def showtraceback(self):
sys.excepthook(*sys.exc_info())
houdiniInterpreter.HoudiniConsole.showtraceback = showtraceback
However, for other uncaught exceptions, like shelf tools, there's currently no way to customize the exception callback. There is an RFE submitted for this
in summary, you can override excepthook in the python shell window, but not shelf tools.
cheers,
chrisg
- Loqy0815
- Member
- 3 posts
- Joined: Nov. 2016
- Offline
- shadesoforange
- Member
- 201 posts
- Joined: July 2015
- Offline
Hey!
I know this has been many years ago, but maybe there has been an update to this, since we would also like to do automatic error reporting
Is there nowadays a way to override exception handling basically for any python code executed within Houdini. It could be within
* Shelftools
* Python nodes
* HDAmodules
* Node/Parm callbacks
* ...
Hooking intofor the Python shell worked, but no success so far for any of the other topics.
I also tried overriding the following:
Any input would be appreciated!
Cheers!
I know this has been many years ago, but maybe there has been an update to this, since we would also like to do automatic error reporting
Is there nowadays a way to override exception handling basically for any python code executed within Houdini. It could be within
* Shelftools
* Python nodes
* HDAmodules
* Node/Parm callbacks
* ...
Hooking into
houdiniInterpreter.HoudiniConsole.showtraceback
I also tried overriding the following:
sys.excepthook houdiniInterpreter.code.sys.excepthook houdiniInterpreter.sys.excepthook
Any input would be appreciated!
Cheers!
Edited by shadesoforange - March 31, 2023 03:51:33
Manuel Köster - Senior Technical Artist @Remedy Entertainment
https://www.remedygames.com/ [www.remedygames.com]
http://shadesoforange.de/ [shadesoforange.de]
https://twitter.com/ShadesOfOrange_ [twitter.com]
https://www.remedygames.com/ [www.remedygames.com]
http://shadesoforange.de/ [shadesoforange.de]
https://twitter.com/ShadesOfOrange_ [twitter.com]
-
- Quick Links