"""This module holds the exceptions of the ``import_export`` app."""


class ImportDataError(Exception):
    """ This raising exception will be returned to be displayed to user. """

    def __init__(self, message, *args, **kwargs):
        self.line = kwargs.pop('line', None)
        self.message = message
        super().__init__(*args, **kwargs)

    def __str__(self):
        if self.line:
            return "%s See line %s." % (self.message, self.line)
        else:
            return "%s" % self.message
