How to use the typedload.exceptions.TypedloadException function in typedload

To help you get started, we’ve selected a few typedload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ltworf / typedload / typedload / exceptions.py View on Github external
See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)


class TypedloadTypeError(TypedloadException, TypeError):
    """
    Exception class, subclass of TypeError.
    See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)


class TypedloadAttributeError(TypedloadException, AttributeError):
    """
    Exception class, subclass of AttributeError.
    See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
github ltworf / typedload / typedload / exceptions.py View on Github external
e += 'Type: %s ' % i.type_
            if i.annotation:
                e += 'Annotation: (%s %s) ' % (i.annotation[0], i.annotation[1])
                path.append(str(i.annotation[1]) if type(i.annotation[1]) != int else '[%d]' % i.annotation[1])
            else:
                path.append(str(None))
            e += 'Value: %s\n' % compress_value(i.value)
        if path:
            if path[0] == str(None):
                path[0] = ''
            e += 'Path: ' + '.'.join(path) + '\n'

        return e


class TypedloadValueError(TypedloadException, ValueError):
    """
    Exception class, subclass of ValueError.
    See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)


class TypedloadTypeError(TypedloadException, TypeError):
    """
    Exception class, subclass of TypeError.
    See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
github ltworf / typedload / typedload / exceptions.py View on Github external
path[0] = ''
            e += 'Path: ' + '.'.join(path) + '\n'

        return e


class TypedloadValueError(TypedloadException, ValueError):
    """
    Exception class, subclass of ValueError.
    See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)


class TypedloadTypeError(TypedloadException, TypeError):
    """
    Exception class, subclass of TypeError.
    See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)


class TypedloadAttributeError(TypedloadException, AttributeError):
    """
    Exception class, subclass of AttributeError.
    See the documentation of TypedloadException for more details.
    """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)