diff options
author | Karthik Nayak <knayak@gitlab.com> | 2023-11-29 20:43:55 +0300 |
---|---|---|
committer | Karthik Nayak <knayak@gitlab.com> | 2023-11-30 18:16:00 +0300 |
commit | 55a15123a6e3822a04d17bf40beafadd5a94eade (patch) | |
tree | f2f021f5c57f28bd01e5504afcfe0bce2dfc14ea | |
parent | e19b5c4c12a8d27ca1f6f8be915364664c5dd052 (diff) |
errors: Fix format directive for two errors
There are 2 instances in our code base where we have two errors and want
to merge them. While the best fix would be to use `errors.Join()`, for
now, let's just fix the type so that the linter doesn't barf.
-rw-r--r-- | internal/command/command.go | 4 | ||||
-rw-r--r-- | internal/praefect/middleware/errorhandler.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/internal/command/command.go b/internal/command/command.go index 0067f9836..4d9524028 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -410,8 +410,8 @@ func (c *Command) wait() { // The standard library sets exit status -1 if the process was terminated by a signal, // such as the SIGTERM sent when context is done. if exitCode, ok := ExitStatus(c.waitError); ok && exitCode == -1 { - //nolint:gitaly-linters // We can only wrap one - c.waitError = fmt.Errorf("%s: %w", c.waitError, c.context.Err()) + // TODO: use errors.Join() to combine errors instead + c.waitError = fmt.Errorf("%s: %w", c.waitError.Error(), c.context.Err()) } } diff --git a/internal/praefect/middleware/errorhandler.go b/internal/praefect/middleware/errorhandler.go index 8dbba24de..738f9c1ed 100644 --- a/internal/praefect/middleware/errorhandler.go +++ b/internal/praefect/middleware/errorhandler.go @@ -18,8 +18,8 @@ func StreamErrorHandler(registry *protoregistry.Registry, errorTracker tracker.E mi, lookupErr := registry.LookupMethod(method) if err != nil { - //nolint:gitaly-linters - return nil, fmt.Errorf("error when looking up method: %w %v", err, lookupErr) + // TODO: use errors.Join() to combine errors instead + return nil, fmt.Errorf("error when looking up method: %w %s", err, lookupErr.Error()) } return newCatchErrorStreamer(stream, errorTracker, mi.Operation, nodeStorage), err |