Package sabayon :: Module errors
[hide private]
[frames] | no frames]

Module errors

source code

Classes [hide private]
  RecoverableApplyErrorException
  FatalApplyErrorException

Functions [hide private]
  errors_have_recoverable_error()
Used to see if there was a recoverable error reported with errors_log_recoverable_exception() or errors_log_recoverable_error().
  errors_log_recoverable_error(domain, msg)
Records the presence of a recoverable error to the debug log (see debuglog).
  errors_have_fatal_error()
Used to see if there was a fatal error reported with errors_log_fatal_error().
  errors_log_fatal_error(domain, msg)
Records the presence of a fatal error to the debug log (see debuglog).
  errors_log_recoverable_exception(domain, msg)
Reports the current exception to the debug log (see debuglog), and records the presence of a recoverable error.
  errors_exit_helper_normally(log_config_filename)
Used only from helper programs for Sabayon.
  errors_exit_with_fatal_exception(domain, log_config_filename)
Exits the program when a fatal exception has occurred.
  checked_callback(domain)
Used as a function decorator.

Variables [hide private]
  _have_recoverable_error = True
  _have_fatal_error = True

Function Details [hide private]

errors_have_recoverable_error()

source code 

Used to see if there was a recoverable error reported with errors_log_recoverable_exception() or errors_log_recoverable_error().

Return value: True if errors_log_recoverable_exception() has been called; False otherwise.

errors_log_recoverable_error(domain, msg)

source code 
Records the presence of a recoverable error to the debug log (see debuglog). This condition can be checked later with errors_have_recoverable_error().

errors_have_fatal_error()

source code 

Used to see if there was a fatal error reported with errors_log_fatal_error().

Return value: True if errors_log_fatal_error() has been called; False otherwise.

errors_log_fatal_error(domain, msg)

source code 
Records the presence of a fatal error to the debug log (see debuglog). This condition can be checked later with errors_have_fatal_error().

errors_log_recoverable_exception(domain, msg)

source code 
Reports the current exception to the debug log (see debuglog), and records the presence of a recoverable error. This condition can be checked later with errors_have_recoverable_error().

errors_exit_helper_normally(log_config_filename)

source code 
Used only from helper programs for Sabayon. First, this dumps the debug log to stderr. Then, it exits the program with exit code utils.EXIT_CODE_NORMAL if there were no recoverable errors during its execution, or with utils.EXIT_CODE_RECOVERABLE if there were recoverable errors.

errors_exit_with_fatal_exception(domain, log_config_filename)

source code 
Exits the program when a fatal exception has occurred. First, this logs the current exception to the debug log. Then, it dumps the debug log to stderr and exits the program with exit code util.EXIT_CODE_FATAL.

checked_callback(domain)

source code 
Used as a function decorator.  You should prefix *all* your callbacks with this decorator:

@checked_callback ("domain")
def my_callback (...):
    ...

If an uncaught exception happens in the callback, the decorator will catch the exception,
call errors.errors_log_fatal_error() to flag the presence of a fatal error, and it will
also exit the main loop.  In turn, the main loop is expected to have this form:

    gtk.main ()
    if errors.errors_have_fatal_error ():
        print "a fatal error occurred" # or anything else you want to do


Variables Details [hide private]

_have_recoverable_error

None
Value:
True                                                                   
      

_have_fatal_error

None
Value:
True