diff --git a/exceptions.py b/exceptions.py new file mode 100644 index 0000000..8963aa4 --- /dev/null +++ b/exceptions.py @@ -0,0 +1,32 @@ +# encoding: utf-8 + +""" +Exceptions used with python-docx. +The base exception class is PythonDocxError. +""" + + +class PythonDocxError(Exception): + """ + Generic error class. + """ + + +class PendingDeprecationWarning(PythonDocxError): + """ + Raised when a tool pending deprecation is used. + """ + + +class InvalidSpanError(PythonDocxError): + """ + Raised when an invalid merge region is specified in a request to merge + table cells. + """ + + +class InvalidXmlError(PythonDocxError): + """ + Raised when invalid XML is encountered, such as on attempt to access a + missing required child element + """