[feedhenry-dev] Weird behavior in fh-mbaas-express

Paolo Haji phaji at redhat.com
Wed Jan 11 15:36:33 UTC 2017


It's definitely weird that the stack trace points to that line since (0 ||
500) === 500

On Wed, Jan 11, 2017 at 1:26 PM, Summers Pittman <supittma at redhat.com>
wrote:

> Hey guys,
>
> While I was debugging this stack trace [https://gist.github.com/secondsun/
> 16088b4212394140b9053a448d7faf63] in Raincatcher I came across this area
> of code : https://github.com/feedhenry/fh-mbaas-express/
> blob/master/lib/mbaas.js#L156
>
> It looks like when request can't connect to a service, err.code is set to
> 0.  Since 0 isn't a valid status code the library will crash the
> application instead of properly returning an error to the application.
>
> I tried doing a check for (err.code === 0) and setting values differently,
> but this block doesn't execute and the error persists.
>
> What should the correct way to handle this situation be?
>
> Summers
>
>
>
> _______________________________________________
> feedhenry-dev mailing list
> feedhenry-dev at redhat.com
> https://www.redhat.com/mailman/listinfo/feedhenry-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/feedhenry-dev/attachments/20170111/b361cb59/attachment.htm>


More information about the feedhenry-dev mailing list