K
Kyle T. Jones
It has been hard for me to determine what would constitute overuse.
Cheers.
Cheers.
It has been hard for me to determine what would constitute overuse.
You can reraise the exception without loosing the stack trace.James said:A rule of thumb I always follow and practice is:
"Let the error lie where it occurred."
or
"Don't hide errors.".
It's good practice to follow IHMO as it makes it easier to find
the source of defects in your function(s). If you constantly
do things like try/except/log then it makes finding the source
harder and may make it harder to identify what caused it.
It has been hard for me to determine what would constitute overuse.
You can reraise the exception without loosing the stack trace.
try:
...
except SomeException, exc:
log(exc)
print 'Hello world'
raise # "raise exc" would loose the original stack trace
It has been hard for me to determine what would constitute overuse.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.