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

Improve general error chaining in case of handling returned errors #12

Open
tomachalek opened this issue Oct 10, 2022 · 0 comments
Open
Labels
enhancement New feature or request we definitely need/want

Comments

@tomachalek
Copy link
Member

There is a new function for this:

api.NewActionError(message string, origErr error) ActionError

e.g.:

	posColumnIdx, err := strconv.Atoi(req.URL.Query().Get("posColIdx"))
	if err != nil {
		api.WriteJSONErrorResponse(
			w,
			api.NewActionError("invalid value for posColIdx", err),
			http.StatusBadRequest)
		return
	}
@tomachalek tomachalek added the enhancement New feature or request we definitely need/want label Oct 10, 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 we definitely need/want
Projects
None yet
Development

No branches or pull requests

1 participant