Closed jsumners closed 8 years ago
Cheers! Wasn't aware of that one. Will get it added.
Have looked at this a bit more and not sure wrapping Boom.internal()
adds anything, as it just passes off to the wrap
or create
function (depending on whether you pass an error or not).
So I think you could just use the reply.boom()
decorated function that is already implemented which does the same thing.
reply.boom(500, new Error(), 'message');
reply.boom(500, 'message', {my_data_attribute: 'something'});
And there is always reply.badImplementation('oops')
for generating 500 responses too.
Let me know if I'm missing anything.
Hmmm, I see now that they have chosen to alias "internal" as "badImplementation" for the public API. I disagree with that choice, but that's irrelevant to this issue. Thank you for clarifying.
Not clear what their intention is with internal vs badImplementation really. The later does set an additional boolean flag on the Boom object so they're perhaps not completely interchangeable.
It's not documented, but Boom has a
.internal()
method for generating a 500 error. It'd be nice to have it in boom-decorators as well.