@author: Frank Brehm
"""
-# own modules
+# Third party modules
from fb_tools.errors import FbAppError, FbError
+# own modules
+from .xlate import XLATOR
+
+_ = XLATOR.gettext
+
+__version__ = '0.9.0'
-__version__ = '0.8.2'
# =============================================================================
class DpxError(FbError):
pass
+
# =============================================================================
class CheckLdapDnAttributesError(DpxLdapError):
"""Special exception class for exceptions in module app.check_ldap_dn_attributes."""
pass
+# =============================================================================
+class DateFormatError(DpxError):
+ """Special exception class, if a date string could not be interpreted as a date string."""
+
+ pass
+
+# =============================================================================
+class WrongDateIsoformatError(DateFormatError):
+ """Special exception class, if a date string could not be interpreted as an ISO date string."""
+
+ # -----------------------------------------------------
+ def __init__(self, datestr):
+ """
+ Initialise a WrongDateIsoformatError exception.
+
+ @param datestr: The date string, which could not be interpreted.
+ @type datestr: str
+
+ """
+ self.datestr = str(datestr)
+
+ # -----------------------------------------------------
+ def __str__(self):
+ """Typecast into a string for error output."""
+ return _('The date string {!r} could not be interpreted as an ISO date.').format(
+ self.datestr)
+
+
# =============================================================================
if __name__ == '__main__':