Add error handling middleware#126
Merged
czechboy0 merged 19 commits intoapple:mainfrom Nov 20, 2024
Merged
Conversation
gayathrisairam
commented
Nov 10, 2024
gayathrisairam
commented
Nov 10, 2024
Collaborator
simonjbeaumont
left a comment
There was a problem hiding this comment.
Thanks for picking this up @gayathrisairam!
I've left some initial comments / questions, and a note on how you can run the linters locally.
czechboy0
requested changes
Nov 11, 2024
Contributor
czechboy0
left a comment
There was a problem hiding this comment.
Looks great overall, added a few suggestions for more polish, mainly in the doc comments.
d235fb3 to
60cb9b9
Compare
czechboy0
requested changes
Nov 19, 2024
Contributor
czechboy0
left a comment
There was a problem hiding this comment.
Thanks for the fixes, added a few more minor suggestions as part of the final pass
Contributor
|
@gayathrisairam please rerun the formatter and unit tests, those are failing |
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
…re.swift Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
Co-authored-by: Honza Dvorsky <honza@apple.com>
0eeeb48 to
4e7c638
Compare
czechboy0
approved these changes
Nov 20, 2024
Contributor
|
Looks great, thank you @gayathrisairam! 👏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Implementation of Improved error handling proposal
Modifications
Added HTTPResponseConvertible protocol
Added ErrorHandlingMiddleware that converts errors confirming to HTTPResponseConvertible to a HTTP response.
Result
The new middleware is an opt-in middleware. So there won't be any change to existing clients.
Clients who wish to have OpenAPI error handling can include the new error middleware in their application.
Test Plan
Added E2E tests to test the new middleware.