Skip to content

Is a default failAction needed to log errors? #129

@rgov

Description

@rgov

I'm completely new to Hapi, I'm just trying to contribute to another project that uses it.

If I am using hapi-pino, is it useful to have a default route.options.response.failAction like the following:

    routes: {
      response: {
        failAction: (request, h, err) => {
          request.log(['error'], err);
          return Boom.badRequest();
        }
      }
    }

Or without this default failAction, will errors still be captured by hapi-pino?

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