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

support error codes and user friendly errors on api response #97

Open
bsushmith opened this issue Oct 13, 2023 · 1 comment
Open

support error codes and user friendly errors on api response #97

bsushmith opened this issue Oct 13, 2023 · 1 comment
Assignees

Comments

@bsushmith
Copy link
Collaborator

Summary
Need to add support for application specific error codes and user friendly error responses in api responses.

For example:
We send the below error response when the grant cannot be renewed yet.
err: failed to create appeal: checking grant extension eligibility: existing grant is not eligible for extension

This error is just the system errors propagated through the stack and sent as API response on create appeal flow. Instead of this, if the api response would have been something like you already have access to this resource. you cannot extend it yet (as example) would have been more user friendly and readable without knowing the guardian domain knowledge.

Additional Context
the actual system errors can be in logs, but the api responses can be more readable. This can be achieved through by catching all errors at the handler level and sending back simplified error back as api response.

@rahmatrhd
Copy link
Member

let's create a mapper of each error -> meaningful message in the handler layer?

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