Skip to content

Commit 9246b0e

Browse files
committed
lint
1 parent 2237a8a commit 9246b0e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

pkg/brevdaemon/agent/heartbeat/heartbeat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (r *Runner) Run(ctx context.Context) error { //nolint:funlen // loop coordi
122122
if err != nil {
123123
if classified := client.ClassifyError(err); classified != nil {
124124
if errors.Is(classified, client.ErrUnauthenticated) {
125-
return classified
125+
return classified //nolint:wrapcheck // classification intentionally returned verbatim for caller handling
126126
}
127127
r.Log.Warn("heartbeat failed", zap.Error(classified))
128128
err = classified

pkg/spark/remote.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"time"
1212

1313
"github.com/spf13/afero"
14+
"github.com/brevdev/brev-cli/pkg/errors"
1415
)
1516

1617
// RemoteRunner executes commands on a Spark host over ssh and returns stdout/stderr.
@@ -25,15 +26,15 @@ func NewRemoteRunner(fs afero.Fs) RemoteRunner {
2526
// Run executes the provided remote shell command via ssh and returns combined output.
2627
func (r RemoteRunner) Run(ctx context.Context, host Host, remoteCmd string) (string, error) {
2728
if host.IdentityFile == "" {
28-
return "", fmt.Errorf("missing identity file for %s", host.Alias)
29+
return "", errors.WrapAndTrace(fmt.Errorf("missing identity file for %s", host.Alias))
2930
}
3031

3132
exists, err := afero.Exists(r.fs, host.IdentityFile)
3233
if err != nil {
3334
return "", err
3435
}
3536
if !exists {
36-
return "", fmt.Errorf("identity file not found at %s", host.IdentityFile)
37+
return "", errors.WrapAndTrace(fmt.Errorf("identity file not found at %s", host.IdentityFile))
3738
}
3839

3940
argv := buildSSHCommand(host, remoteCmd)
@@ -44,7 +45,7 @@ func (r RemoteRunner) Run(ctx context.Context, host Host, remoteCmd string) (str
4445
cmd.Stderr = &buf
4546

4647
if err := cmd.Run(); err != nil {
47-
return buf.String(), fmt.Errorf("ssh to %s failed for command %q: %w\noutput:\n%s", hostLabel(host), remoteCmd, err, buf.String())
48+
return buf.String(), errors.WrapAndTrace(fmt.Errorf("ssh to %s failed for command %q: %w\noutput:\n%s", hostLabel(host), remoteCmd, err, buf.String()))
4849
}
4950
return buf.String(), nil
5051
}

0 commit comments

Comments
 (0)