Skip to content

Adding recover functionality #3964

Open

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions