我刚刚将我的节点api切换到使用节点-mysql。它一直在抑制我的错误/堆栈跟踪,这使得开发和调试成为一场噩梦。例如,我正在编写一个新特性,并得到了以下错误:
/opt/figo/banking/node_modules/mysql/lib/protocol/Parser.js:78
throw err; // Rethrow non-MySQL errors
^
TypeError: string is not a function
mysql
模块是必要的,重新定义我最初的错误信息。我怎么能让它停止这样做?我只想知道它到底在哪里失败,而不是node-mysql
决定重新抛出我的错误。
发布于 2017-08-11 09:39:28
如果您正在抛出错误,它应该是一个有效的错误对象,我认为您正在抛出string.Try
throw new Error("oops something happened");
发布于 2017-08-16 14:07:06
您正在传递string
而不是int
或int
而不是string
我的意思是,您使用错误的value
传递data type
。不是对mysql,而是对其他功能,一步一步地检查。
检查正在传递的data type
of var
使用什么
console.log(typeof(yourVar));
https://stackoverflow.com/questions/36985814
复制相似问题