I just switched my node api over to use node-mysql. It keeps suppressing my errors/stack traces making development and debugging a nightmare. For example, I am writing a new feature 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
The mysql
module is essential re-wording my original error messages. How can I get it to stop doing this? I want to just see exactly where it failed, not where node-mysql
decided to rethrow my error.
If you are throwing error it should a valid error object.I think you are throwing string.Try this
throw new Error("oops something happened");