Axum testing weird problem #1839
Unanswered
Gabriel-Rosmart
asked this question in
Q&A
Replies: 2 comments 6 replies
-
Can you post a full reproduction script that we can |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've uploaded a repository, so full code is available, which i think should be easier to read. All test are there. Every other important thing either on |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm making a web server that has some routes that return a
Result<Response, AppError>
whereAppError
implementsIntoResponse
, so technically it never returns an error actually, however when testing, endpoints always return 500 status code, even when they work perfectly well (making a request gives correct status code).Here is the code of AppError:
And here a test (obviously under mod tests):
I'm confused about what to do, don't know if i should be using a fallible service or change something in the test.
This problem came up to me while trying to use the
?
operator for a better readability in my handlersI have to state that the test works perfectly if i return
Response
in the handler instead ofResult<Response, AppError>
Beta Was this translation helpful? Give feedback.
All reactions