From 34ee5d3371b43d589963e5b3dcf1cec9d95a3947 Mon Sep 17 00:00:00 2001 From: Eth3rn4lBl4ck <37368673+pedrorsantana@users.noreply.github.com> Date: Fri, 26 Feb 2021 18:33:13 -0300 Subject: [PATCH] Inclusion of create target error description (#966) * Inclusion of the error description Is your feature request related to a problem? Please describe. During a failure in creating the target, the exception caused did not come with a description capable of bringing a quick understanding of the problem, just the stacktrace. Describe the solution you'd like Use the existing module to include messages. --- internal/target/repository_tcp_target.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/target/repository_tcp_target.go b/internal/target/repository_tcp_target.go index 776198e30..9903917aa 100644 --- a/internal/target/repository_tcp_target.go +++ b/internal/target/repository_tcp_target.go @@ -79,7 +79,7 @@ func (r *Repository) CreateTcpTarget(ctx context.Context, target *TcpTarget, opt var targetOplogMsg oplog.Message returnedTarget = t.Clone() if err := w.Create(ctx, returnedTarget, db.NewOplogMsg(&targetOplogMsg)); err != nil { - return errors.Wrap(err, op) + return errors.Wrap(err, op, errors.WithMsg("unable to create target")) } msgs = append(msgs, &targetOplogMsg) if len(newHostSets) > 0 {