gdb error should wrap original underlying database error like MySQLError (#2402)

This commit is contained in:
Wesley Wu 2023-02-08 19:38:11 +08:00 committed by GitHub
parent 013f8b216a
commit 005668aca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,10 +279,9 @@ func (c *Core) DoCommit(ctx context.Context, in DoCommitInput) (out DoCommitOutp
c.writeSqlToLogger(ctx, sqlObj)
}
if err != nil && err != sql.ErrNoRows {
err = gerror.NewCodef(
err = gerror.WrapCode(
gcode.CodeDbOperationError,
"%s, %s",
err.Error(),
err,
FormatSqlWithArgs(in.Sql, in.Args),
)
}