fix: add 422 Error class and status_code to DataCiteError
use a defaultdict to map status codes to error classes, defaults to DataCiteServerError for status_code >= 500 and DataCiteRequestError for all others
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
- [x] I'm aware of the code of conduct.
- [x] I've created logical separate commits and followed the commit message format.
- [ ] I've added relevant test cases.
- [ ] I've added relevant documentation.
- [ ] I've marked translation strings.
- [ ] I've identified the copyright holder(s) and updated copyright headers for touched files (>15 lines contributions).
- [x] I've NOT included third-party code (copy/pasted source code or new dependencies).
- If you have added third-party code (copy/pasted or new dependencies), please reach out to an architect.
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:
- You license your contribution under the same terms as the current repository’s license.
- You agree that you have the right to license your contribution under the current repository’s license.
Hi @alee. Sorry for the delay in looking at this. It looks like status_code needs to be added to all the tests in order for this improvement to go through. It also might not be a bad idea to run the tests against the live DataCite endpoint and see what the actual response is. I think a bunch of the test responses don't match what DataCite currently uses. I'll also add this to my list of things to work on, but not sure when I'll get to it.