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

Simplify the management of custom errors thrown in controllers and hooks #807

Merged
merged 20 commits into from
Sep 22, 2020

Conversation

LoicPoullain
Copy link
Member

@LoicPoullain LoicPoullain commented Sep 4, 2020

Issue

Resolves #638

Solution and steps

See commits.

New features

  • The interface IAppController
  • HttpResponseInternalServerError has two new optional properties: error and ctx. The renderError function assigns a value to them.

Breaking

  • CreateAppOptions.methods removed. AppController.handleError can be used directly.
  • req.foal.ctx does not exist anymore in post middleware.
  • Hook post functions are still executed when an error is thrown in a hook or in the controller method.

Checklist

  • Add/update/check docs (code comments and docs/ folder).
  • Add/update/check tests.
  • Update/check the cli generators.

@LoicPoullain LoicPoullain added this to Work In Progress in Issue tracking via automation Sep 4, 2020
@LoicPoullain LoicPoullain merged commit ac09e53 into v2-0-0 Sep 22, 2020
Issue tracking automation moved this from Work In Progress to Done / Closed This Release Sep 22, 2020
@LoicPoullain LoicPoullain deleted the handle-error branch September 22, 2020 12:59
@LoicPoullain LoicPoullain mentioned this pull request Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue tracking
  
Done / Closed This Release
Development

Successfully merging this pull request may close these issues.

None yet

1 participant