You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reviewing the code, in the api/v1/errors.go section,
I noticed that in the apiError function, you are using a panic() function, as a return in case an error occurs converting to JSON using json.Marshal(), but in the api/v1/groupe_routes.go file, I don't see that you are handling that panic().
Suggested Solution (optional)
My suggestion is to add a recover() function, to handle the error returned by the panic() function, that way we will be using the functionality for which this function was created.
In any case, if you do not want to make that change, I suggest changing the panic() function to log.fatal(), since you do not handle a recover() with panic() anyway.
Already existing or connected issues / PRs (optional)
No response
The text was updated successfully, but these errors were encountered:
Hi @Alexnerotd - have you actually hit this as an issue ?
This code has been around since 2017 and given that the net/http server already recovers from panics, this doesn't seem relevant unless there is a concrete case where this is a problem
Feature Description
Reviewing the code, in the api/v1/errors.go section,
I noticed that in the apiError function, you are using a panic() function, as a return in case an error occurs converting to JSON using json.Marshal(), but in the api/v1/groupe_routes.go file, I don't see that you are handling that panic().
Suggested Solution (optional)
My suggestion is to add a recover() function, to handle the error returned by the panic() function, that way we will be using the functionality for which this function was created.
In any case, if you do not want to make that change, I suggest changing the panic() function to log.fatal(), since you do not handle a recover() with panic() anyway.
Already existing or connected issues / PRs (optional)
No response
The text was updated successfully, but these errors were encountered: