INNER CODE UNIT · JavaScript

createHandler

godaddy/terminus · lib/terminus.js:77

  const createHandler = (listener) => {
    const check = hasSetHandler
      ? () => {}
      : async (healthCheck, res) => {
        if (state.isShuttingDown && sendFailuresDuringShutdown) {
          return sendFailure(res, { onSendFailureDuringShutdown, statusError, statusErrorResponse })
        }
        let info
        try {
          info = await healthCheck({ state })
        } catch (error) {
          logger('healthcheck failed', error)
          const statusCode = error.statusCode
          const statusResponse = error.statusResponse
          return sendFailure(
            res,
            {
              error: error.causes,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…