osmanraifgunes osmanraifgunes - 1 year ago 168
Node.js Question

Bluebird throwing exception at source code

I am using bluebirdjs for nodejs application. It throws an exception from its source code.

Line :

try {throw new Error(); } catch (e) {ret.lastLineError = e;}

Path : bluebird/js/release/util.js

Line : 374

This exception seems unnecessary to me. It only throws exception. Is it rational to delete this line?

Same code also exists inside async.js at line 3.

Answer Source

In IE an Error object will not have a .stack property unless it goes a through try catch. The .stack property is needed to see which line and file the code is in.

ret.lastLineError = new Error() would therefore only work in firefox and chrome

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download