Exceptions with additional instance variables
22 Dec
2008
22 Dec
'08
2:02 a.m.
Hello,
I'm trying to implement custom exception that have to carry some useful info by means of instance members, to be used like:
try: // some code except MyException, data: // use data.errorcode, data.errorcategory, data.errorlevel, data.errormessage and some others
The question is - how to implement the instance variables with PyErr_NewException? Or should I use another approach? And how to set values of these variables at the moment of exception? Should I use PyErr_SetString or PyErr_SetObject?
I'm lost.
Thanks in advance. Kind regards.
5596
Age (days ago)
5596
Last active (days ago)
1 comments
2 participants
participants (2)
-
chojrak11@gmail.com
-
Guilherme Polo