Skip to content

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

Open
NishantJoshi00 wants to merge 1 commit intomainfrom
error-handling
Open

feat(error): handle json error as json instead of plaintext#125
NishantJoshi00 wants to merge 1 commit intomainfrom
error-handling

Conversation

@NishantJoshi00
Copy link
Copy Markdown
Contributor

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