JS intenta atrapar err.printstacktrace

try{
  //some error
} catch (err){
  console.log(err.stack);
}

Busy Boar