try { throw "Could not parse that text!"; } catch(e) { console.log(e.stack); //log the stack trace to console }