You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Spell is a duck typed promise implementation by providing promise methods such as .then(), .catch(), and .finally(). It is convenient to customize the constructor and async logic in this way, but it loses stack trace comparing the native implementation.
With await + thenable objects, we can have decent stack trace already:
Error: ER_DUP_ENTRY: Duplicateentry'-1'forkey'articles.PRIMARY'atQuery.Sequence._packetToError(node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)atQuery.ErrorPacket(node_modules/mysql/lib/protocol/sequences/Query.js:79:18)atProtocol._parsePacket(node_modules/mysql/lib/protocol/Protocol.js:291:23)atParser._parsePacket(node_modules/mysql/lib/protocol/Parser.js:433:10)atParser.write(node_modules/mysql/lib/protocol/Parser.js:43:10)atProtocol.write(node_modules/mysql/lib/protocol/Protocol.js:38:16)atSocket.<anonymous>(node_modules/mysql/lib/Connection.js:88:28)atSocket.<anonymous>(node_modules/mysql/lib/Connection.js:526:10)ataddChunk(internal/streams/readable.js:290:12)atreadableAddChunk(internal/streams/readable.js:265:9)atSocket.Readable.push(internal/streams/readable.js:204:10)atTCP.onStreamRead(internal/stream_base_commons.js:188:23)--------------------atProtocol._enqueue(node_modules/mysql/lib/protocol/Protocol.js:144:48)atPoolConnection.query(node_modules/mysql/lib/Connection.js:198:25)at/Users/nil/Projects/cyjake/leoric/src/drivers/mysql/index.js:75:18atnewPromise(<anonymous>)
at MysqlDriver.query (src/drivers/mysql/index.js:74:21)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Spell.ignite (src/spell.js:654:18)
at async Context.<anonymous> (test/unit/spell.test.js:49:5)
The stack above -------------------- are the cause error, and the stack below it I believe is captured by mysqljs/mysql itself, with options.verbose turned on (which is the default).
Currently
Spell
is a duck typed promise implementation by providing promise methods such as.then()
,.catch()
, and.finally()
. It is convenient to customize the constructor and async logic in this way, but it loses stack trace comparing the native implementation.The text was updated successfully, but these errors were encountered: