Skip to content
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

Merged
merged 4 commits into from
Jun 13, 2022
Merged

Conversation

niklasad1
Copy link
Member

Closing #775

@niklasad1 niklasad1 requested a review from a team as a code owner June 5, 2022 11:59
@niklasad1 niklasad1 changed the title fix(servers): more descriptive errors calls fail fix(servers): more descriptive errors when calls fail Jun 5, 2022
@@ -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);
Copy link
Member Author

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.

Copy link
Collaborator

@jsdw jsdw left a 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

Copy link
Member

@TarikGul TarikGul left a 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

@niklasad1 niklasad1 merged commit 5a344c0 into master Jun 13, 2022
@niklasad1 niklasad1 deleted the na-fix-775 branch June 13, 2022 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants