opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
79 stars 58 forks source link

Improve error logging on workflow-package #7295

Open naftis opened 1 day ago

naftis commented 1 day ago

Currently, errors happening in handlers aren't being logged at all. If an error happens for example here, nothing is eventually console.logging it.

We could add this (or similar) to the createServer function:

  server.ext('onPreResponse', (request, reply) => {
    if (request.response instanceof Error) {
      console.error(request.response)
    }

    return reply.continue
  })

to get a log of the actual error.