diff --git a/docs/source/conf.py b/docs/source/conf.py index 4d60f1b8..8781dc4b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,7 +20,6 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) - # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. diff --git a/docs/source/exceptions.rst b/docs/source/exceptions.rst new file mode 100644 index 00000000..56b98331 --- /dev/null +++ b/docs/source/exceptions.rst @@ -0,0 +1,41 @@ +.. + Copyright 2017 AT&T Intellectual Property. + All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain + a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations + under the License. + + +Promenade Exceptions +==================== + +.. list-table:: + :widths: 5 50 + :header-rows: 1 + + * - Exception Name + - Description + * - ApiError + - .. autoexception:: promenade.exceptions.ApiError + :members: + :show-inheritance: + :undoc-members: + * - InvalidFormatError + - .. autoexception:: promenade.exceptions.InvalidFormatError + :members: + :show-inheritance: + :undoc-members: + * - ValidationException + - .. autoexception:: promenade.exceptions.ValidationException + :members: + :show-inheritance: + :undoc-members: diff --git a/docs/source/index.rst b/docs/source/index.rst index 99ce03d5..d5a807d3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -35,3 +35,4 @@ Promenade Configuration Guide configuration/index troubleshooting/index api + exceptions diff --git a/promenade/exceptions.py b/promenade/exceptions.py index 69545b21..e1373948 100644 --- a/promenade/exceptions.py +++ b/promenade/exceptions.py @@ -153,6 +153,10 @@ class PromenadeException(Exception): """ Base error containing enough information to make a promenade-formatted error + + **Message:** *Auth is not being handled by any policy engine*. + + **Troubleshoot:** """ EXIT_CODE = 1 @@ -221,6 +225,18 @@ class PromenadeException(Exception): class ApiError(PromenadeException): """ An error to handle general api errors. + + **Message:** *Expectation Failed*. + + **Troubleshoot:** + + **Message:** *Forbidden*. + + **Troubleshoot:** + + **Message:** *Unauthenticated*. + + **Troubleshoot:** """ title = 'Api Error' @@ -229,7 +245,17 @@ class ApiError(PromenadeException): class InvalidFormatError(PromenadeException): """ - An exception to cover invalid input formatting + An exception to cover invalid input formatting. + + **Message:** *: Invalid JSON in body: *. + + **Troubleshoot:** *Make sure the path is correct and the body is valid + JSON*. + + **Message:** *: Bad input, no body provided*. + + **Troubleshoot:** *Make sure the path is correct and the a body is + provided*. """ title = 'Invalid Input Error' @@ -237,6 +263,15 @@ class InvalidFormatError(PromenadeException): class ValidationException(PromenadeException): + """ + **Message:** *"schema" is a required document key*. + + **Troubleshoot:** + + **Message:** *Only kind or schema may be specified, not both*. + + **Troubleshoot:** + """ title = 'Validation Error' status = falcon.HTTP_400 diff --git a/tox.ini b/tox.ini index a0e435ef..dd2da86e 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,8 @@ whitelist_externals = rm deps = sphinx>=1.6.2 sphinx_rtd_theme==0.2.4 + -r{toxinidir}/requirements-frozen.txt + -r{toxinidir}/test-requirements.txt commands = rm -rf docs/build python setup.py build_sphinx {posargs}