More sanity with exception types and raises docs.
[pyutils.git] / src / pyutils / datetimes / dateparse_utils.py
index d6665d76fc8dbbafd86b5f7c865b922323f3568f..586008d526466537ea5c57d8dbd8ef711a6dcf01 100755 (executable)
@@ -154,7 +154,11 @@ class ParseException(Exception):
 
 
 class RaisingErrorListener(antlr4.DiagnosticErrorListener):
-    """An error listener that raises ParseExceptions."""
+    """An error listener that raises ParseExceptions.
+
+    Raises:
+        ParseException: on parse error
+    """
 
     def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e):
         raise ParseException(msg)
@@ -305,6 +309,9 @@ class DateParser(dateparse_utilsListener):
             A datetime.datetime representing the parsed date/time or
             None on error.
 
+        Raises:
+            ParseException: an exception happened during parsing
+
         .. note::
 
             Parsed date expressions without any time part return