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