Node-mysql Rotrow Errors without MySQL

I just switched api node to node-mysql . He continues to suppress my mistakes / stacks, making development and debugging a nightmare. For example, I am writing a new function and I get this error:

/opt/figo/banking/node_modules/mysql/lib/protocol/Parser.js:78
    throw err; // Rethrow non-MySQL errors
          ^
TypeError: string is not a function

A module mysqlis a substantial reformulation of my original error messages. How can I make him stop doing this? I just want to see where exactly this happened, and not where node-mysqlI decided to reset my error.

+4
source share
2 answers

If you throw an error, it should have a valid error.I think you throw string.Try this

throw new Error("oops something happened");
0
source

string int int string

, value, data type. mysql, , .

, data type var, ,

console.log(typeof(yourVar));
0

All Articles