SHARE
TWEET

Untitled

a guest May 26th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module.exports = {
  2.   die: function(err) {
  3.       let e = new Error();
  4.       let frame = e.stack.split("\n")[2];
  5.       let arr = frame.split(" ");
  6.       // let functionName = arr[5];
  7.       let where = arr[6].split(/[:()]/);
  8.       let fileName = where[1];
  9.       let lineNumber = where[2];
  10.       throw (err || "Died").toString().replace(/\w+:\s*/g, '') +" at "+ fileName +" line "+ lineNumber +".";
  11.   },
  12.  
  13. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top