Skip to content

Errors in core, create with @fastify/errors or use native Errors  #4521

@Uzlopak

Description

@Uzlopak

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Well in #4520 there are basically two opinions about errors:

  • all thrown errors should be created by @fastify/errors
  • errors which are exposed at runtime should be generated by @fastify/errors ans errors which are thrown at startup should be native errors.

For the first you could argue that alot of errors are already transformed and it was always the target to replace all native Errors.
For the latter you could argue, that in fastify.js we throw native Errors because the input objects are already invalid.

Can we have a clarification, a clarifying discussion or can i have a link to place were this was already discussed and/or clarified, please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions