From 4f0de3f4ccaf2415c6be29baa986682a79ac2e80 Mon Sep 17 00:00:00 2001 From: Alex Zagorodniuk Date: Fri, 26 Jun 2015 16:40:57 -0400 Subject: [PATCH] add missing exceptions --- exceptions.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 exceptions.py 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 + """