Skip to content

Cleanup backend json error structs #2625

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

Merged
merged 4 commits into from
Jul 13, 2020

Conversation

jtgeibel
Copy link
Member

@jtgeibel jtgeibel commented Jul 11, 2020

Finish some cleanup work for how JSON error messages are generated. All associated types are moved to errors::json.

Going forward, there is some direct usage of Response::builder() in the middleware. These return text instead of JSON. We should look into this usage to see if some of them should be switched to JSON. For any remaining we could consider a set of errors::text helpers.

r? @JohnTitor

The error types maps to status `403 Forbidden`, not `400 Unauthorized`.
jtgeibel added 3 commits July 11, 2020 19:19
Some direct usage exists so the NotFound type is also re-exported.
The remaining helper structs that build json errors were also moved to
this module.
@jtgeibel jtgeibel changed the title Rename error struct to match its behavior Cleanup backend json error structs Jul 12, 2020
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, looks good!

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jul 13, 2020

📌 Commit 75a3eec has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Jul 13, 2020

⌛ Testing commit 75a3eec with merge dc894b6...

@bors
Copy link
Contributor

bors commented Jul 13, 2020

☀️ Test successful - checks-travis
Approved by: JohnTitor
Pushing dc894b6 to master...

@bors bors merged commit dc894b6 into rust-lang:master Jul 13, 2020
@jtgeibel jtgeibel deleted the fix-naming-of-error-type branch September 20, 2020 04:06
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.

4 participants