Skip to content

feat: ✨ include error reason in API error#76

Open
martonvago wants to merge 19 commits into
mainfrom
feat/error-reason
Open

feat: ✨ include error reason in API error#76
martonvago wants to merge 19 commits into
mainfrom
feat/error-reason

Conversation

@martonvago
Copy link
Copy Markdown
Contributor

Description

This PR adds the reason why a request to Zenodo failed to the error. These reasons are sometimes helpful, sometimes not, but better to have them. I will say that they are not using HTTP status codes correctly, but whatever...

Closes #62

Needs a thorough review.

Checklist

  • Ran just run-all

reason = response_json.get("message", reason)

raise requests.HTTPError(
f"{response.status_code} Error: {reason}",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the description, they don't always use HTTP status codes correctly (e.g., fetching a nonexistent deposit gives 403 permission denied instead of 404 not found). Maybe we should mention this? On the whole, the message is still useful because sometimes it's very detailed feedback about what's wrong.

@martonvago martonvago moved this from Todo to In progress in Platform development Apr 22, 2026
@martonvago martonvago changed the base branch from refactor/api-return-types to refactor/reorganise-files April 28, 2026 11:54
Base automatically changed from refactor/reorganise-files to main April 30, 2026 07:17
@martonvago martonvago moved this from In progress to In review in Platform development May 4, 2026
@martonvago martonvago requested a review from lwjohnst86 May 4, 2026 07:00
@martonvago martonvago marked this pull request as ready for review May 4, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant