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

[Chore] Consistent log severity for errors in the API shim #1340

Open
danail-branekov opened this issue Jul 8, 2022 · 0 comments
Open

[Chore] Consistent log severity for errors in the API shim #1340

danail-branekov opened this issue Jul 8, 2022 · 0 comments
Assignees
Labels

Comments

@danail-branekov
Copy link
Member

danail-branekov commented Jul 8, 2022

The errors from the appierrors package reflect known erroneous recoverable states that should not be logged with severity ERROR, they should be logged as INFO instead. We have introduced a small LogAndReturn utility to check whether an error is an ApiError and if true, log it as INFO, log it as ERROR otherwise. Let's use it everywhere in the shim where logging is done.

The only exception from apierrors being recoverable is the UnknownError. This error is only used to present unexpected and unknown errors and the shim code (handlers and repositories) are not expected to use it e.g. here. instead, they should just return the error without wrapping it with an UnknownError.
Having said that, we could consider making UnknownError private to wherever it is presented (currently here) so that we make sure it is not used elsewhere.

@danail-branekov danail-branekov created this issue from a note in Korifi - Backlog (⚙️ Chores) Jul 8, 2022
@danail-branekov danail-branekov changed the title [Chore] Consistent log severity for errors [Chore] Consistent log severity for errors in the API shim Jul 8, 2022
@danail-branekov danail-branekov moved this from ⚙️ Chores to 🔄 In progress in Korifi - Backlog Jul 11, 2022
@danail-branekov danail-branekov self-assigned this Jul 11, 2022
@danail-branekov danail-branekov moved this from 🔄 In progress to ✅ Done in Korifi - Backlog Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants