In Chrome, when an exception occurs, it prints a stack trace to the console log. This is extremely useful, but unfortunately in cases where an exception has been rethrown th
In my situation console.log() was not possible. What I did is:
}catch( error ){
// 'throw' replaces the stack trace.
// To preserve the stack add it to the message.
error.message += '; Stack trace: ' + error.stack;
throw error;
}