不要怂,就是干,撸起袖子干!

Commit d7fcf213 by Andy Edwards Committed by GitHub

fix: add missing sql and parameters properties to some query errors (#12299)

1 parent c31d68da
......@@ -53,6 +53,8 @@ class Query extends AbstractQuery {
return new Promise((resolve, reject) => {
const handleTransaction = err => {
if (err) {
err.sql = sql;
err.parameters = parameters;
reject(this.formatError(err));
return;
}
......
......@@ -126,6 +126,8 @@ class Query extends AbstractQuery {
if (rows[0] && rows[0].sequelize_caught_exception !== undefined) {
if (rows[0].sequelize_caught_exception !== null) {
throw this.formatError({
sql,
parameters,
code: '23505',
detail: rows[0].sequelize_caught_exception
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!