quick search:
 

Catch Your Exception and Log It Too

Submitted by: swampmonkey
Last Edited: 2004-10-14

Category: Product Development

Average rating is: 0.0 out of 5 (0 ratings)

Description:
When catching an exception (to, for instance, show a pretty error screen for the general public) the exception is not logged in the error_log. It turns out that it is very easy to catch your exception and log it too.

Source (Text):
import sys

try:
    #whatever
except Exception:
    err_log = self.error_log
    err_log.raising(sys.exc_info())

    #finish processing exception

Comments:

No Comments