Closed dominykas closed 4 years ago
When catching Boom errors and handling specific response codes, one has to check for:
Boom.isBoom(err) && err.output.statusCode === 404
This needs extra coverage for the && condition.
&&
It would be handy to just be able to say Boom.isBoom(err, 404) or Boom.isBoom(err, { statusCode: 404 }).
Boom.isBoom(err, 404)
Boom.isBoom(err, { statusCode: 404 })
See above.
Happy to PR.
Support plan
Context
What problem are you trying to solve?
When catching Boom errors and handling specific response codes, one has to check for:
This needs extra coverage for the
&&
condition.It would be handy to just be able to say
Boom.isBoom(err, 404)
orBoom.isBoom(err, { statusCode: 404 })
.Do you have a new or modified API suggestion to solve the problem?
See above.
Happy to PR.