发生SQL错误时,是否可以在nestjs + typeorm中包含行号和文件名?

时间:2019-09-05 08:20:50

标签: nestjs typeorm

如果发生SQL错误,则调用堆栈仅追溯到类似

at Query.Sequence._packetToError (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/Connection.js:91:28)
at Socket.<anonymous> (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/Connection.js:525:10)
at Socket.emit (events.js:203:13)
at Socket.EventEmitter.emit (domain.js:471:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at TCP.onStreamRead (internal/stream_base_commons.js:166:17)
--------------------
at Protocol._enqueue (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at PoolConnection.query (/Applications/MAMP/htdocs/nestCms/node_modules/mysql/lib/Connection.js:201:25)
at MysqlQueryRunner.<anonymous> (/Applications/MAMP/htdocs/nestCms/src/driver/mysql/MysqlQueryRunner.ts:155:36)
at step (/Applications/MAMP/htdocs/nestCms/node_modules/tslib/tslib.js:133:27)
at Object.next (/Applications/MAMP/htdocs/nestCms/node_modules/tslib/tslib.js:114:57)
at fulfilled (/Applications/MAMP/htdocs/nestCms/node_modules/tslib/tslib.js:104:62)
at processTicksAndRejections (internal/process/task_queues.js:85:5) 

关于如何快速识别实际从哪个行和文件发送查询的任何线索?

0 个答案:

没有答案