Skip to content

Ensure that API endpoints return JSON errors #7708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Dec 13, 2023

to quote from the code comment:

The built-in extractors in axum return plain text errors, but our API contract promises JSON errors. This middleware converts such plain text errors into corresponding JSON errors, allowing us to use the axum extractors without having to care about the error responses.

Related:

@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-backend ⚙️ labels Dec 13, 2023
@bors
Copy link
Contributor

bors commented Dec 13, 2023

☔ The latest upstream changes (presumably 2019763) made this pull request unmergeable. Please resolve the merge conflicts.

@Turbo87 Turbo87 changed the title Ensure that axum extractors return JSON errors Ensure that API endpoints return JSON errors Dec 13, 2023
@Turbo87 Turbo87 merged commit 8204d53 into rust-lang:main Dec 13, 2023
@Turbo87 Turbo87 deleted the error-middleware branch December 13, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants