hapijs / boom

HTTP-friendly error objects
Other
2.93k stars 193 forks source link

Boom.wrap is not a function #269

Closed RachitBhargava99 closed 4 years ago

RachitBhargava99 commented 4 years ago

Support plan

Context

How can we help?

Here is a short snippet of where I am using this. Using this function raises the error, "TypeError: Boom.wrap is not a function"


const Boom = require('boom')

exports.wrapNano = function wrapNanoError(cb) {
    return function(err) {
        if (err) {
            Boom.wrap(err, err.statusCode || 500)
        }
        cb.apply(null, arguments)
    }
}
Marsup commented 4 years ago

Using default's branch documentation on a very old version of the package is unlikely to work. Either use the up-to-date package (@hapi/boom) or refer to the old documentation.