Closed
Description
This is a feature request.
if let Err(e) = crate::database::check_and_add_user(state.as_ref(), &user).await {
// `e` is of type mongodb::error::Error
match e.kind.as_ref() {
mongodb::error::ErrorKind::Custom(s) => {
// `s` is of type &Arc<dyn Any + Send + Sync>
return Err((
StatusCode::BAD_REQUEST,
// implement here
// <-- how to convert s to &str or String
));
}
_ => {
return Err((
StatusCode::INTERNAL_SERVER_ERROR,
format!("Failed to create user"),
))
}
};
}
```