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

Unify error responses in pinpoint web #8979

Closed
ga-ram opened this issue Jun 27, 2022 · 0 comments
Closed

Unify error responses in pinpoint web #8979

ga-ram opened this issue Jun 27, 2022 · 0 comments
Assignees
Milestone

Comments

@ga-ram
Copy link
Contributor

ga-ram commented Jun 27, 2022

Current implementation has more than 3 types of error responses in pinpoint web, and there is no written standards on how to handle error on failed requests.

I'd like to suggest throwing ResponseStatusException(throw new ResponseStatusException(HttpStatus.xxx, "error message")) when error occurs so that Spring can make the response data in its ErrorController.

error response example:

HTTP Status Code: 500
Response:
{
  "timestamp": ...,
  "status": ...,
  "error":"...",
  "exception":"...",
  "trace":"...",
  "message":"...",
  "path":"...",
  "data": {
    "requestInfo": {"method": "...", "url": "...", "headers": {}, "parameters":{}}
  }
}

This way, there is lower chance to see white label page error since front end will handle the responses with above format even when unexpected exceptions has occurred.

ga-ram added a commit to ga-ram/pinpoint that referenced this issue Jun 28, 2022

Verified

This commit was signed with the committer’s verified signature. The key has expired.
holiman Martin HS
ga-ram added a commit to ga-ram/pinpoint that referenced this issue Jun 28, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
ga-ram added a commit to ga-ram/pinpoint that referenced this issue Jun 29, 2022

Verified

This commit was signed with the committer’s verified signature.
blakehhuynh Blake Huynh
ga-ram added a commit that referenced this issue Jun 29, 2022

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
@ga-ram ga-ram self-assigned this Jun 29, 2022
@ga-ram ga-ram added this to the 2.5.0 milestone Jun 29, 2022
ga-ram added a commit to ga-ram/pinpoint that referenced this issue Jul 4, 2022

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
ga-ram added a commit that referenced this issue Jul 5, 2022

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
ga-ram added a commit to ga-ram/pinpoint that referenced this issue Jul 11, 2022

Unverified

This user has not yet uploaded their public signing key.
… to keep all error responses in JSON
ga-ram added a commit that referenced this issue Jul 11, 2022
@emeroad emeroad closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants