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.
This commit is contained in:
Eth3rn4lBl4ck authored and GitHub committed 2021-02-26 13:33:13 -08:00
1 parent 4738ceee5d
commit 34ee5d3371
1 file changed
+1 -1
+1 -1
View File
@@ -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 {