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

feat: if json Serialize failure return 500 #321

Closed
wants to merge 6 commits into from
Closed

Conversation

fundon
Copy link
Contributor

@fundon fundon commented Sep 5, 2019

Description

If JSON Serialize failure return 500 and Error message.

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Sorry, something went wrong.

.body(Body::from(v)),
Err(e) => res
.status(http::status::StatusCode::INTERNAL_SERVER_ERROR)
.body(Body::from(e.to_string())),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't leak details to the client here; instead logging using log::error and returning an empty body seems like a better option (:

@fundon
Copy link
Contributor Author

fundon commented Sep 6, 2019

CI's network problem.

@secretfader
Copy link

secretfader commented Oct 24, 2019

Looks to me like the requested changes were made (I agree, we don't want to expose the reason serialization failed, by default). I'd like to see this merged into tide-core, perhaps with a plan to allow custom error handling in a later PR.

Any objections to rebasing on master and pushing again, @fundon?

fundon and others added 6 commits October 27, 2019 10:05

Verified

This commit was signed with the committer’s verified signature.
fundon Fangdun Tsai

Verified

This commit was signed with the committer’s verified signature.
fundon Fangdun Tsai

Verified

This commit was signed with the committer’s verified signature.
fundon Fangdun Tsai
Updates the requirements on [juniper](https://github.com/graphql-rust/juniper) to permit the latest version.
- [Release notes](https://github.com/graphql-rust/juniper/releases)
- [Commits](graphql-rust/juniper@juniper-0.13.1...juniper-v0.14.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Verified

This commit was signed with the committer’s verified signature.
fundon Fangdun Tsai
Updates the requirements on [uuid](https://github.com/uuid-rs/uuid) to permit the latest version.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/commits)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Verified

This commit was signed with the committer’s verified signature.
fundon Fangdun Tsai

Verified

This commit was signed with the committer’s verified signature.
fundon Fangdun Tsai
Resolve rustasync/http-rs#316
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.

None yet

4 participants