1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-22 16:30:11 +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 ) { function handleError( ex ) {
var msg = '', exitCode; var msg = '', exitCode;
@ -123,8 +124,10 @@ function handleError( ex ) {
var idx = msg.indexOf('Error: '); var idx = msg.indexOf('Error: ');
var trimmed = idx === -1 ? msg : msg.substring( idx + 7 ); 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( ('ERROR: ' + trimmed.toString()).red.bold );
console.log( ex.stack.gray);
}
else else
console.log( trimmed.toString() ); console.log( trimmed.toString() );