o .&a @sVddlZeeZGdddeZGdddeZGdddeZGdd d eZ dS) Ncs eZdZdZfddZZS)BaseOperationErrorziA {error_type} error ({error_code}) occurred when calling the {operation_name} operation: {error_message}csF|jj||||d}tt||||_||_||_||_||_ dS)N) error_code error_message error_typeoperation_name) MSG_TEMPLATEformatsuperr__init__rrrrhttp_status_code)selfrrrrr msg __class__5/usr/lib/python3/dist-packages/awscli/errorhandler.pyr s zBaseOperationError.__init__)__name__ __module__ __qualname__rr __classcell__rrrrrsrc@ eZdZdS) ClientErrorNrrrrrrrr$rc@r) ServerErrorNrrrrrr(rrc@s eZdZdZddZddZdS) ErrorHandlera This class is responsible for handling any HTTP errors that occur when a service operation is called. It is registered for the ``after-call`` event and will have the opportunity to inspect all operation calls. If the HTTP response contains an error ``status_code`` an appropriate error message will be printed and the handler will short-circuit all further processing by exiting with an appropriate error code. c Ksvtd|jd}d}|jdkrd}t}n|jdks|jdkr#d}t}|dur9||\}}|||||j|jddS)NzHTTP Response Code: %diserverii-client)rrrrr )LOGdebug status_coderr_get_error_code_and_messagename) r http_responseparsedmodelkwargsr error_classcodemessagerrr__call__7s" zErrorHandler.__call__cCs8d}d}d|vr|d}|d||d|fS||fS)NUnknownErrorCodeMessage)get)r responser(r)errorrrrr!Hs z(ErrorHandler._get_error_code_and_messageN)rrr__doc__r*r!rrrrr,s r) logging getLoggerrr Exceptionrrrobjectrrrrrs