trace back exceptions : Exception Trace : Exception PYTHON examples


PYTHON examples » Exception » Exception Trace »

 

trace back exceptions


trace back exceptions


import sys, traceback


MyError = 'hello'

def oops():
    raise MyError, 'world'



def safe(entry, *args):
    try:
        apply(entry, args)                 catch everything else
    except:
        traceback.print_exc()
        print 'Got', sys.exc_type, sys.exc_value

if __name__ == '__main__':
    safe(oops)

           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Exception
» Exception Trace


Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0