Closed micfan closed 5 years ago
actix does not print backtrace. but it should log errors and response body should contain error body
You're right, got the error message Display by error!()
:
impl From<Error> for ServiceError {
fn from(error: Error) -> ServiceError {
error!("{}", error);
// Right now we just care about UniqueViolation from diesel
// But this would be helpful to easily map errors as our app grows
match error {
Error::DatabaseError(kind, info) => {
if let DatabaseErrorKind::UniqueViolation = kind {
let message =
info.details().unwrap_or_else(|| info.message()).to_string();
return ServiceError::BadRequest(message);
}
ServiceError::InternalServerError
}
_ => ServiceError::InternalServerError,
}
}
}
hi, what can I do when the HTTP 500 occured? I only got a 500 error message, but don't konw what happen, my debugger's breakpoint not take effect at all
you can implement backtrace for your error, actix-web does not support backtrace
ok. For the websocket in actix-web-actors = "1.0.0"
, where can I set a break point in debugger to inspect when the client connected?
In your handler
the break point in WS handler can work in the actix/examples.
I deduce that my own handler is not correct, so that the web::resource.to(my_handler)
return HTTP 500 error. I will continue find why, thank you!
I still do not know how to dive into Rust for this situation.
But after read the actrix document, the Actor Model
concept, I found I lost this line in my WS code:
When start this actor, the WS server won't return HTTP 500
Can you give me a hint, thanks.
I got this output, normally here would output the traceback errors, I guess ...