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

fix - docs - hooks - error handling #2000

Merged
merged 4 commits into from Dec 26, 2019
Merged

Conversation

wallasfmorais
Copy link
Contributor

Checklist

  • (n/a) run npm run test and npm run benchmark
  • (n/a) tests and/or benchmarks are included
  • documentation is changed or added
  • commit message and code follows Code of conduct

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the try-catches and rethrow altogether.

@delvedor delvedor added the documentation Improvements or additions to documentation label Dec 22, 2019
Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @mcollina.

@wallasfmorais
Copy link
Contributor Author

(1):

const result = await asyncMethod()
// Error occurred
if (!result) {
throw new Error('Some errors occurred.')
}

or
(2):

await asyncMethod()
// Error occurred
throw new Error('Some errors occurred.')

@mcollina
Copy link
Member

  1. or even remove completely the throw.

@wallasfmorais
Copy link
Contributor Author

Alright, in a moment.

Changing as requested
@RafaelGSS
Copy link
Member

😕 In "files changed" show me an alteration that I already did it 321c6b6.

I think that is a bug of Github.

@wallasfmorais
Copy link
Contributor Author

Same here, I saw just before I send the PR.
Even fork from 1 min before and was the same.

Without knowing what to do, I keeped.

@wallasfmorais
Copy link
Contributor Author

So, I close this and send another PR or no need?

@mcollina, @delvedor

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@delvedor delvedor merged commit df3d571 into fastify:master Dec 26, 2019
delvedor pushed a commit that referenced this pull request Jan 18, 2020
* fix - docs - hooks - error handling

* Update Hooks.md

Changing as requested

* Fix - docs - FluentSchema - link

* fix - docs - readme - reqs/sec
delvedor added a commit that referenced this pull request Jan 19, 2020
* Docs(Fluent-Schema.md): fix fluent schema repo link (#2007)

* fix - docs - hooks - error handling (#2000)

* fix - docs - hooks - error handling

* Update Hooks.md

Changing as requested

* Fix - docs - FluentSchema - link

* fix - docs - readme - reqs/sec

* add fastify-explorer to ecosystem (#2003)

* Add a recommendations doc (#1997)

* Add a recommendations doc

* Update docs/Recommendations.md

* Fix TOC typo in recommendations (#2009)

* docs(Typescript): typo (#2016)

* docs: fix onResponse parameter (#2020)

Co-authored-by: Vitaliy Abramov <i@kassad.ru>
Co-authored-by: Wallas F Morais <wallas@fmorais.com.br>
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
Co-authored-by: James Sumners <james@sumners.email>
Co-authored-by: Rafael Gonzaga <rafael.nunu@hotmail.com>
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants