Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

exception.py 673 Bytes
Newer Older
1 2 3 4
# -*- coding: utf-8 -*-
""" invenio_tools.exception

"""
LE GAC Renaud's avatar
LE GAC Renaud committed
5 6


7 8 9 10 11 12 13 14 15 16 17 18
class ExceptionUTF8(Exception):
    """Exception in which unicode arguments are encoded as a string.

    """
    def __init__(self, *args):
        args = (list(args) if isinstance(args, tuple) else args)
        for i in range(len(args)):
            if isinstance(args[i], unicode):
                args[i] = args[i].encode('utf-8')
        Exception.__init__(self, *args)


LE GAC Renaud's avatar
LE GAC Renaud committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
class CdsException(ExceptionUTF8):
    pass


class CheckException(ExceptionUTF8):
    pass


class Marc12Exception(ExceptionUTF8):
    pass


class RecordException(ExceptionUTF8):
    pass


class XmlException(ExceptionUTF8):
    pass