forked from datadesk/python-documentcloud
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added exceptions to the correct directory..
- Loading branch information
1 parent
0c43a5f
commit 789bcc3
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Exceptions | ||
=========== | ||
|
||
The DocumentCloud Python library and the API have several potential errors. | ||
|
||
Importing Exceptions | ||
-------------------- | ||
|
||
>>> from documentcloud.exceptions import APIError, DuplicateObjectError, CredentialsFailedError, DoesNotExistError, MultipleObjectsReturnedError | ||
|
||
DocumentCloudError | ||
------------------- | ||
|
||
.. class:: documentcloud.exceptions.DocumentCloudError(Exception) | ||
Base class for errors for python-documentcloud | ||
|
||
DuplicateObjectError | ||
--------------------- | ||
|
||
.. class:: documentcloud.exceptions.DuplicateObjectError(DocumentCloudError) | ||
Raised when an object is added to a unique list more than once. | ||
|
||
CredentialsFailedError | ||
---------------------- | ||
|
||
.. class:: documentcloud.exceptions.CredentialsFailedError(DocumentCloudError) | ||
Raised if unable to obtain an access token due to bad login credentials. | ||
|
||
APIError | ||
-------- | ||
|
||
.. class:: documentcloud.exceptions.APIError(DocumentCloudError) | ||
Any other error calling the API. | ||
|
||
DoesNotExistError | ||
----------------- | ||
|
||
.. class:: documentcloud.exceptions.DoesNotExistError(APIError) | ||
Raised when the user asks the API for something it cannot find. | ||
|
||
MultipleObjectsReturnedError | ||
---------------------------- | ||
|
||
.. class:: documentcloud.exceptions.MultipleObjectsReturnedError(APIError) | ||
Raised when the API returns multiple objects when it expected one. |