import { boomify , isBoom } from '@hapi/boom' ; import type { CustomHttpResponseOptions , ResponseError } from 'src/core/server' ; export function wrapError ( error ) { const boom = isBoom ( error ) ? error : boomify ( error ) ; return { body : boom , headers : boom . output . headers as { [ key ] : string ; } , statusCode : boom . output . statusCode , } ; }