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

Authentication errors don't throw errors, instead modify the status and response body directly. #74

Open
brocoli opened this issue Feb 1, 2019 · 1 comment

Comments

@brocoli
Copy link

brocoli commented Feb 1, 2019

In Operation.js line 315, notice how the code sets a message in the response body directly. This makes it hard for applications to format the error response, for instance, if we need to always return RFC 7807 Problem Details for HTTP APIs.

Since the rest of Exegesis already has an HttpError type defined and even an option parameter that controls whether Exegesis should handle the conversion of these errors into HTTP error responses, shouldn't the authentication process also use this code flow?

It would avoid creating extra code in our applications specifically for 401 responses.

@jwalton
Copy link
Contributor

jwalton commented Feb 1, 2019

Sounds reasonable to me. I'd welcome a PR. :)

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

No branches or pull requests

2 participants