TypeORM 怎么打印出错行?

2021-02-26 13:38:54 +08:00
 freshgoose

用了 ActiveRecord 模式后,打印出来的调用栈是这样的,涉及的文件全都不是我自己写的源码,完全看不出来是在哪一行出错的。谷歌搜了一遍,好像没人关心这个问题。

    at new QueryFailedError (/src/error/QueryFailedError.ts:9:9)
    at Query.<anonymous> (/src/driver/mysql/MysqlQueryRunner.ts:193:37)
    at Query.<anonymous> (/node_modules/mysql/lib/Connection.js:526:10)
    at Query._callback (/node_modules/mysql/lib/Connection.js:488:16)
    at Query.Sequence.end (/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
    at Query.ErrorPacket (/node_modules/mysql/lib/protocol/sequences/Query.js:92:8)
    at Protocol._parsePacket (/node_modules/mysql/lib/protocol/Protocol.js:291:23)
    at Parser._parsePacket (/node_modules/mysql/lib/protocol/Parser.js:433:10)
    at Parser.write (/node_modules/mysql/lib/protocol/Parser.js:43:10)
    at Protocol.write (/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/node_modules/mysql/lib/Connection.js:88:28)
    at Socket.<anonymous> (/node_modules/mysql/lib/Connection.js:526:10)
    at Socket.emit (events.js:210:5)
    at Socket.EventEmitter.emit (domain.js:475:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:182:23)
715 次点击
所在节点    问与答
2 条回复
freshgoose
2021-02-26 13:42:43 +08:00
有人知道吗,难道真要自己一行一行审计代码?
oott123
2021-02-26 15:23:49 +08:00
看起来是你的 async stack trace 失灵了,可能和 bluebird 之类的 promise 库有关

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/756470

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX