Repository navigation
More detailed error messages - #381
Merged
Merged
Conversation
Contributor
|
I agree that we need to be careful; in particular, InternalServerError is expected to be caught by the proxy and replaced with a different page - per normal proxy behavior. This change looks good to me. Merging. |
Contributor
|
Thank you! |
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.
This PR adds the ability for the server to send more detailed error messages back to the client. I did not add any new error codes or types. Instead, I just modified
sendErrorand cleaned up error messages in a few places.As it did previously,
sendErrortakes a string, interface, and a HTTP status code. The change is the interface is included in the error message if all of the following conditions apply:statusCodeFromError.core.ServerInternalError.If these conditions apply, sendError sends both the string passed to
sendErrorand the error message passed in the interface parameter to the client. This allows for more detailed error messages in cases like #344, which now returns:Coming with this, we need to be careful when wrapping internal error messages in error types that isn't
core.ServerInternalError. I went through all of the current code and removed any instances where we do this (the three changes in registration-authority.go). I'm not certain there was a problem, but I think it's better to err on the safe side to prevent leaking any internal information.