improve error message for package gdb

This commit is contained in:
John Guo
2022-05-19 17:27:13 +08:00
parent 24f5b2782d
commit 7753fc6fe1

View File

@ -128,15 +128,6 @@ func (c *Core) DoFilter(ctx context.Context, link Link, sql string, args []inter
return sql, args, nil
}
type sqlParsingHandlerInput struct {
DoCommitInput
FormattedSql string
}
type sqlParsingHandlerOutput struct {
DoCommitInput
}
// DoCommit commits current sql and arguments to underlying sql driver.
func (c *Core) DoCommit(ctx context.Context, in DoCommitInput) (out DoCommitOutput, err error) {
// Inject internal data into ctx, especially for transaction creating.
@ -266,7 +257,7 @@ func (c *Core) DoCommit(ctx context.Context, in DoCommitInput) (out DoCommitOutp
if err != nil && err != sql.ErrNoRows {
err = gerror.NewCodef(
gcode.CodeDbOperationError,
"%s, %s\n",
"%s, %s",
err.Error(),
FormatSqlWithArgs(in.Sql, in.Args),
)