-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(servers): more descriptive errors when calls fail #790
Conversation
core/src/server/helpers.rs
Outdated
@@ -119,8 +119,8 @@ impl MethodSink { | |||
tracing::error!("Error serializing response: {:?}", err); | |||
|
|||
if err.is_io() { | |||
let data = to_json_raw_value(&format!("Exceeded max limit {}", self.max_response_size)).ok(); | |||
let err = ErrorObject::borrowed(OVERSIZED_RESPONSE_CODE, &OVERSIZED_RESPONSE_MSG, data.as_deref()); | |||
let data = format!("Exceeded max limit {}", self.max_response_size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes more sense to use ErrrorObject::owned
when we already have to allocate a String
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! just a wee grammar nit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice QOL update for errors
Closing #775