Skip to content

Commit

Permalink
Backport of cli: prevent panic on operator debug into release/1.4.x (
Browse files Browse the repository at this point in the history
…#14993)

This pull request was automerged via backport-assistant
  • Loading branch information
hc-github-team-nomad-core authored Oct 20, 2022
1 parent 4723e96 commit 97b890e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/14992.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: prevent a panic when the Nomad API returns an error while collecting a debug bundle
```
2 changes: 1 addition & 1 deletion command/operator_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ func writeResponseStreamOrErrorToFile[T any](obj []T, apiErr error, getWriterFn
defer writer.Close()

if apiErr != nil {
wrapped := errorWrapper{Error: err.Error()}
wrapped := errorWrapper{Error: apiErr.Error()}
return writeJSON(wrapped, writer)
}

Expand Down

0 comments on commit 97b890e

Please sign in to comment.