Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
botocore
/
File Content:
errorfactory.pyc
� ?��Xc @ sP d d l m Z d d l m Z d e f d � � YZ d e f d � � YZ d S( i����( t ClientError( t get_service_module_namet BaseClientExceptionsc B s) e Z e Z d � Z d � Z d � Z RS( c C s | | _ d S( s Base class for exceptions object on a client :type code_to_exception: dict :param code_to_exception: Mapping of error codes (strings) to exception class that should be raised when encountering a particular error code. N( t _code_to_exception( t selft code_to_exception( ( s7 /tmp/pip-build-uEGWVr/botocore/botocore/errorfactory.pyt __init__ s c C s | j j | | j � S( sN Retrieves the error class based on the error code This is helpful for identifying the exception class needing to be caught based on the ClientError.parsed_reponse['Error']['Code'] value :type error_code: string :param error_code: The error code associated to a ClientError exception :rtype: ClientError or a subclass of ClientError :returns: The appropriate modeled exception class for that error code. If the error code does not match any of the known modeled exceptions then return a generic ClientError. ( R t getR ( R t error_code( ( s7 /tmp/pip-build-uEGWVr/botocore/botocore/errorfactory.pyt from_code s c C sK g | j j � D] } | j ^ q } t d | | d j | � f � � d S( Ns7 %r object has no attribute %r. Valid exceptions are: %ss , ( R t valuest __name__t AttributeErrort join( R t namet exception_clst exception_cls_names( ( s7 /tmp/pip-build-uEGWVr/botocore/botocore/errorfactory.pyt __getattr__. s "( R t __module__R R R R ( ( ( s7 /tmp/pip-build-uEGWVr/botocore/botocore/errorfactory.pyR s t ClientExceptionsFactoryc B s# e Z d � Z d � Z d � Z RS( c C s i | _ d S( N( t _client_exceptions_cache( R ( ( s7 /tmp/pip-build-uEGWVr/botocore/botocore/errorfactory.pyR 9 s c C sB | j } | | j k r7 | j | � } | | j | <n | j | S( s� Creates a ClientExceptions object for the particular service client :type service_model: botocore.model.ServiceModel :param service_model: The service model for the client :rtype: object that subclasses from BaseClientExceptions :returns: The exceptions object of a client that can be used to grab the various different modeled exceptions. ( t service_nameR t _create_client_exceptions( R t service_modelR t client_exceptions( ( s7 /tmp/pip-build-uEGWVr/botocore/botocore/errorfactory.pyt create_client_exceptions<