Skip to content
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

feat(error): handle json error as json instead of plaintext #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NishantJoshi00
Copy link
Member

Description

This pull request includes several updates primarily focused on refactoring the use of the axum library and improving error handling. The most important changes include adding new dependencies, modifying error handling with JsonError, and updating various route handlers to use the new Json type.

Dependency Updates:

  • Cargo.toml: Added axum-extra and modified axum to include the macros feature.

Error Handling Improvements:

  • src/error.rs: Introduced JsonError struct and implemented From<JsonRejection> and IntoResponse for better error handling.
  • src/middleware.rs: Updated middleware to use error::Json for JSON extraction.

Route Handler Updates:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants