Skip to content

Commit

Permalink
Add exceptions to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
airblast-dev committed Mar 12, 2024
1 parent f6a8940 commit cb86671
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
63 changes: 63 additions & 0 deletions docs/exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Exceptions
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`



###############
Base Exception
###############

All of the exceptions defined in the library are subclassed from this class.

.. warning::
Sadly the error's returned by the API are not documented in any way, so it is recommended to handle this exception where exceptions are being handled in any form.
In such case that the exception is stated in the API response, but this exception is raised, please create an issue so a proper exceptions can be implemented.

.. autoclass:: vshieldpy.exceptions.base_exception.VShieldpyException
:members:

###############
Authentication
###############

Authentication related exceptions. Exceptions in this section are expected to be raised in a few cases.

- The token is structurely invalid (In other words invalidated before a request is even sent.)
- The token was rejected by the API.
- A new token was requested via the panel (Which means the old token is invalid.)

.. note::
While it may be obvious, this means the exception could theoretically be raised from any request that is sent to the API.

.. automodule:: vshieldpy.exceptions.auth_exceptions
:members:


######################
Idenftifier Exceptions
######################

The exceptions in this section can only be raised from functions that take in an identifier of some sort.

.. automodule:: vshieldpy.exceptions.id_exceptions
:members:

####################
Parameter Exceptions
####################

Exceptions here are most likely to be raised whilst sending a request to order a server.

.. automodule:: vshieldpy.exceptions.parameter_exceptions
:members:







1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Welcome to vshieldpy's documentation!
./server_params.rst
./api_types.rst
./products.rst
./exceptions.rst
./env_vars.rst


Expand Down

0 comments on commit cb86671

Please sign in to comment.