1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-05 09:56:22 +00:00

Show call stack on error.

Hat tip @Furchin.
This commit is contained in:
hacksalot 2015-12-24 16:22:29 -05:00
parent 3d41528059
commit 358c397bb9

View File

@ -91,6 +91,7 @@ function getOpts( args ) {
};
}
// TODO: refactor
function handleError( ex ) {
var msg = '', exitCode;
@ -123,8 +124,10 @@ function handleError( ex ) {
var idx = msg.indexOf('Error: ');
var trimmed = idx === -1 ? msg : msg.substring( idx + 7 );
if( !ex.fluenterror || ex.fluenterror < 3 )
if( !ex.fluenterror || ex.fluenterror < 3 ) { // TODO: magic #s
console.log( ('ERROR: ' + trimmed.toString()).red.bold );
console.log( ex.stack.gray);
}
else
console.log( trimmed.toString() );