Replies: 1 comment 2 replies
-
I needed to add Is there a way to have anyhow handle boxed errors? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I am attempting to implement two examples together:
https://github.com/tokio-rs/axum/blob/main/examples/anyhow-error-response/src/main.rs
https://github.com/tokio-rs/axum/blob/main/examples/diesel-postgres/src/main.rs
The database table:
Cargo.toml:
errors.rs:
api.rs:
But I'm getting two errors. The first one is the first
?
afterinteract(...).await??
where it says:which goes away if I replace my
AppError(anyhow::Error)
withAppError(Box<dyn std::error::Error>)
.And the second error: is with
.route("/messages", get(get_messages))
:I'm not sure how to handle this error?
Would appreciate any suggestions on how to implement generic error handling in axum with diesel.
axum version
0.7.4
Beta Was this translation helpful? Give feedback.
All reactions