<s> import logging <EOL> import traceback <EOL> class ErrorMixin ( object ) : <EOL> def get_startup_errors ( self ) : <EOL> if hasattr ( self , "<STR_LIT>" ) : <EOL> return self . _startup_errors <EOL> return [ ] <EOL> def add_startup_error ( self , error_message ) : <EOL> if not hasattr ( self , "<STR_LIT>" ) : <EOL> self . _startup_errors = [ ] <EOL> self . _startup_errors . append ( error_message ) <EOL> def startup_error ( self , error_message , exception_instance ) : <EOL> error_message = "<STR_LIT>" % ( <EOL> error_message , <EOL> "<STR_LIT>" % traceback . format_exc ( exception_instance ) <EOL> ) <EOL> self . add_startup_error ( error_message ) <EOL> logging . critical ( error_message ) <EOL> def runtime_error ( self , error_message ) : <EOL> logging . critical ( error_message ) </s>
