Module Expr Str Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Assign NameStore NameLoad FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If Call NameLoad NameLoad NameLoad body Return Call SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args defaults vararg kwarg body Expr Str TryExcept body Return Call NameLoad NameLoad NameLoad handlers ExceptHandler type Call AttributeLoad NameLoad attr name NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Raise AttributeLoad NameLoad attr NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Index Num orelse Raise decorator_list Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return NameLoad decorator_list NameLoad decorator_list
N/A N/A Common cloud error wrappers. N/A sys functools wraps CloudException N/A Exception N/A N/A Base cloud exception. N/A N/A InvalidNameException N/A CloudException N/A N/A Bad name. N/A N/A NotPermittedException N/A CloudException N/A N/A Access is not permitted N/A N/A NoContainerException N/A CloudException N/A N/A No container found. N/A N/A NoObjectException N/A CloudException N/A N/A No storage object found. N/A N/A CloudExceptionWrapper N/A object N/A N/A Exception translator.

    This class wraps a "real" underlying cloud class exception and translates
    it to a "common" exception class from this module. The exception stack
    from the wrapped exception is preserved through some :meth:`sys.exc_info`
    hackery.

    It is implemented as a decorator such that you can do something like::

        class MyWrapper(CloudExceptionWrapper):
            '''Convert exception to another one.'''
            translations = { Exception: NotImplementedError }

        @MyWrapper()
        def foo():
            raise Exception("Hi.")

        foo()

    The alternate way is to handle the translations directly in a member
    function::

        class MyWrapper(CloudExceptionWrapper):
            '''Convert exception to another one.'''
            def translate(self, exc):
                if isinstance(exc, Exception):
                    return NotImplementedError

                return None

        @MyWrapper()
        def foo():
            raise Exception("Hi.")

        foo()

    which produces output like::

        Traceback (most recent call last):
          File "...", line ..., in <module>
            foo()
          File "...", line ..., in wrapped
            return operation(*args, **kwargs)
          File "...", line ..., in foo
            raise Exception("Hi.")
        NotImplementedError: Hi.

    So, we can see that we get a different exception with the proper stack.

    Overriding classes should implement the ``translations`` class variable
    dictionary for translating an underlying library exception to a class
    in this module. See any of the data implementation modules for examples.
     N/A translations N/A N/A _excepts None __new__ N/A N/A cls N/A args kwargs N/A N/A New. N/A obj N/A N/A object __new__ cls args kwargs N/A N/A N/A obj translations N/A N/A lazy_translations N/A N/A cls lazy_translations N/A lazy_translations N/A N/A N/A obj translations lazy_translations N/A obj N/A excepts N/A N/A cls N/A N/A N/A Return tuple of underlying exception classes to trap and wrap.

        :rtype: ``tuple`` of ``type``
         N/A N/A N/A cls _excepts None N/A N/A N/A cls _excepts N/A tuple N/A N/A N/A cls translations keys N/A N/A cls _excepts N/A classmethod translate N/A N/A self exc N/A N/A N/A Return translation of exception to new class.

        Calling code should only raise exception if exception class is passed
        in, else ``None`` (which signifies no wrapping should be done).
         N/A key N/A N/A N/A self translations keys N/A N/A N/A isinstance exc key N/A N/A N/A N/A N/A self translations N/A key N/A unicode exc N/A None N/A __call__ N/A N/A self operation N/A N/A N/A Call and wrap exceptions. wrapped N/A N/A N/A args kwargs N/A N/A Wrapped function. N/A N/A N/A N/A operation args kwargs N/A N/A N/A N/A N/A self excepts N/A exc N/A N/A new_exc N/A N/A self translate exc N/A new_exc N/A N/A N/A new_exc __class__ new_exc N/A N/A N/A sys exc_info N/A 2 N/A N/A N/A N/A wraps operation N/A wrapped N/A lazy_translations N/A N/A cls N/A N/A N/A Lazy translations definitions (for additional checks). N/A None N/A classmethod N/A