Skip to content

Filter / pass errors to client-side #160

@brillout

Description

@brillout

By default, for security reasons, Telefunc doesn't pass errors to the client-side.

But this isn't convenient, a good compromise could be:

import { config } form 'telefunc'

config.passErrorToClient = (error) => {
   // Pass error if it has a 4xx status code (some validation libraries automatically generate a status code)
   return error.statusCode.startsWith('4')

   // Completely opt out
   return true
}

See also: https://telefunc.com/error-handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions