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

[feat] Custom Error Response with two different Error() functions #28

Open
singhvikash11 opened this issue Mar 3, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@singhvikash11
Copy link
Member

Is your feature request related to a problem? Please describe.
With the current exceptions message, it's hard to get understand which part of the service is failing like data-layer, logic-layer, calling another service etc.

Describe the solution you'd like
Clear and concise details of error so it could help to understand what is the problem.
https://github.com/google/go-github/blob/master/github/github.go#L770

Describe alternatives you've considered
Create a custom Error type to add details about caller, component, request body etc. This custom type will have two different implementations for Error() methods:

  • One implementation of the Error function will print the error message we want to display to end-users either as Api response or CLI response.
  • Other implementations of the Error function will print enhanced error details while we logged using logger.
@bsushmith bsushmith added the enhancement New feature or request label Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants