-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add 422 Error and status_code attribute to DataCiteError-s
- add 422 Unprocessable Entity error class, resolves #89 - minor refactoring to use a defaultdict data structure to map status codes to error classes instead of an if/elif conditional chain. - future status codes can be supported by adding a new DataCiteError subtype and an entry to the DataCiteErrorFactory.ERROR_CLASSES dictionary - includes the status code in the Error class so client code can retrieve the status code from the raised Exception, resolves #98 defaults to DataCiteServerError for any unhandled status_code >= 500 and DataCiteRequestError if there is not an exact match
- Loading branch information
Showing
1 changed file
with
59 additions
and
17 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