Open kouli opened 5 years ago
That's a great point, thank you!
I don't think this is a valid report.
Commonly the code looks like
raise error.StatusInformation(
errorIndication=errind.decryptionError
)
Since none of the instances from errind
is called directly by raise
, the trackback information is not accumulated.
Due to exception chaining introduced in Python 3 (probably), exceptions should not be "singletons": i.e. each exception raised should be a separate individual instance of
Exception
. Please, do not use those singletons as e.g. inpysnmp.proto.errind
(get rid of therequestTimedOut
instance and always instantiate exceptions usingRequestTimedOut()
). See output (exception's traceback) of the following example to see why it is bad - singleton obtains an accumulated traceback from all places it was raised at: