From e40e3fe77657d5aec4d8064f8a8b51546256576e Mon Sep 17 00:00:00 2001 From: Pavel Merzlyakov Date: Tue, 26 Dec 2023 19:36:58 +0300 Subject: [PATCH] fix saving diff collection --- tpl/macros_struct.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tpl/macros_struct.twig b/tpl/macros_struct.twig index d68a15a..d30dd35 100644 --- a/tpl/macros_struct.twig +++ b/tpl/macros_struct.twig @@ -305,7 +305,9 @@ func Save{{ ctx.s.name }}CollectionDiff(ctx context.Context, dbe metadb.Execer, queryBuilder.WriteString(builder.update.String()) _, saveErr := dbe.ExecContext(ctx, queryBuilder.String(), builder.rawValues...) - return errors.Wrap(saveErr, queryBuilder.String()) + if saveErr != nil { + return errors.Wrap(saveErr, queryBuilder.String()) + } } return nil