From 045b3f6c422cddb2f8bf81039e9c7ffc47d27ee0 Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Sat, 18 Sep 2021 21:16:44 -1000 Subject: Create exceptions module to contain exception classes --- asciidoc/api.py | 5 +---- asciidoc/asciidoc.py | 6 +----- asciidoc/exceptions.py | 8 ++++++++ 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 asciidoc/exceptions.py diff --git a/asciidoc/api.py b/asciidoc/api.py index 1e3d215..8b8a1a0 100644 --- a/asciidoc/api.py +++ b/asciidoc/api.py @@ -1,8 +1,5 @@ from . import asciidoc - - -class AsciiDocError(Exception): - pass +from .exceptions import AsciiDocError class Options(object): diff --git a/asciidoc/asciidoc.py b/asciidoc/asciidoc.py index 07b23f7..9ab1dd2 100644 --- a/asciidoc/asciidoc.py +++ b/asciidoc/asciidoc.py @@ -38,6 +38,7 @@ from ast import literal_eval from collections import OrderedDict from .collections import AttrDict, InsensitiveDict +from .exceptions import EAsciiDoc CONF_DIR = os.path.join(os.path.dirname(__file__), 'resources') METADATA = {} @@ -71,11 +72,6 @@ DEFAULT_NEWLINE = '\r\n' # Utility functions and classes. # --------------------------------------------------------------------------- - -class EAsciiDoc(Exception): - pass - - class Trace(object): """ Used in conjunction with the 'trace' attribute to generate diagnostic diff --git a/asciidoc/exceptions.py b/asciidoc/exceptions.py new file mode 100644 index 0000000..8f32a4a --- /dev/null +++ b/asciidoc/exceptions.py @@ -0,0 +1,8 @@ +class EAsciiDoc(Exception): + """Exceptions raised by the main asciidoc process""" + pass + + +class AsciiDocError(Exception): + """Exceptions raised by the asciidoc API""" + pass -- cgit v1.2.1