#NEWLINE# def __exit__( self , ex_type , ex_value , ex_traceback ) : #NEWLINE# #INDENT# if ( not ex_value ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if isinstance ( ex_value , exception . OCCIException ) : #NEWLINE# #INDENT# raise Fault ( exception . ConvertedException ( code = ex_value . code , explanation = ex_value . format_message ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( ex_value , exception . NotImplemented ) : #NEWLINE# #INDENT# raise Fault ( exception . ConvertedException ( code = ex_value . code , explanation = ex_value . format_message ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( ex_value , TypeError ) : #NEWLINE# #INDENT# exc_info = ( ex_type , ex_value , ex_traceback ) #NEWLINE# LOG . error ( 'Exception handling resource: %s' , ex_value , exc_info = exc_info ) #NEWLINE# raise Fault ( webob . exc . HTTPBadRequest ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( ex_value , Fault ) : #NEWLINE# #INDENT# LOG . info ( 'Fault thrown: %s' , ex_value ) #NEWLINE# raise ex_value #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( ex_value , webob . exc . HTTPException ) : #NEWLINE# #INDENT# LOG . info ( 'HTTP exception thrown: %s' , ex_value ) #NEWLINE# raise Fault ( ex_value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# LOG . exception ( ( 'Unexpected exception: %s' % ex_value ) ) #NEWLINE# raise Fault ( webob . exc . HTTPInternalServerError ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return False