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

Move createError utility to its own package #2339

Merged
merged 5 commits into from Jun 27, 2020
Merged

Conversation

delvedor
Copy link
Member

@delvedor delvedor commented Jun 21, 2020

As titled, the idea is to offer a simple and consistent way to plugin author for creating error objects.
The idea started from fastify/under-pressure#54 (comment).

I'm thinking to extract our warnings utility in the same external module as well, so plugin authors could use the same mechanism for emitting warnings.
You can find the extracted module here.

Feedback?

TODO:

  • Update typescript types
  • Update documentation

Checklist

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

@delvedor delvedor added discussion Issues or PRs with this label will never stale plugin Identify a pr to the doc that adds a plugin. v3.x Issue or pr related to Fastify v3 labels Jun 21, 2020
@delvedor delvedor requested a review from a team June 21, 2020 16:05
Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollina
Copy link
Member

Code's ok, doc is missing.

Copy link
Member

@Ethan-Arrowood Ethan-Arrowood left a comment

Choose a reason for hiding this comment

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

lgtm checking out fastify-error now

@delvedor
Copy link
Member Author

@mcollina @jsumners @Ethan-Arrowood how do you feel about moving in that module our warnings utility as well?
We could export it as a separate module as well.

@jsumners
Copy link
Member

I'd see it as a separate module. Maybe fastify-deprecation or something. Keep to the "do one thing and do it well" model.

@delvedor delvedor marked this pull request as ready for review June 27, 2020 08:39
@delvedor delvedor requested a review from mcollina June 27, 2020 08:39
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

@delvedor delvedor merged commit bf18412 into master Jun 27, 2020
@delvedor delvedor deleted the create-custom-errors branch June 27, 2020 08:49
@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
discussion Issues or PRs with this label will never stale plugin Identify a pr to the doc that adds a plugin. v3.x Issue or pr related to Fastify v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants