From 7753fc6fe1a7c15da17511c15f451790ffe1983e Mon Sep 17 00:00:00 2001 From: John Guo Date: Thu, 19 May 2022 17:27:13 +0800 Subject: [PATCH] improve error message for package gdb --- database/gdb/gdb_core_underlying.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/database/gdb/gdb_core_underlying.go b/database/gdb/gdb_core_underlying.go index a3c177cb61f..5f0e669e45a 100644 --- a/database/gdb/gdb_core_underlying.go +++ b/database/gdb/gdb_core_underlying.go @@ -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), )