Handling errors as exceptions



main()
   try:
   ......
            result = do_something(filename)
            do_something_else(result)
    except Exception:
        # decide what to do