Skip to content

Return value from fastify.errorHandler is thrown away #581

@aguo-ntech

Description

@aguo-ntech

Prerequisites

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

Fastify version

latest

Plugin version

latest

Node.js version

latest

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

N/A

Description

@fastify/static calls fastify.errorHandler() (source).

However, it throws away the return value, which breaks cases where the error handler returns a value, rather than calling reply.send.

Vanilla Fastify allows, and properly handles, returning the reply from the error handler.

Link to code that reproduces the bug

https://github.com/abrahamguo/repro/tree/fastify-static

Expected Behavior

@fastify/static should return the return value of fastify.errorHandler().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions