mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
cli: prevent panic on operator debug (#14992)
If the API returns an error during debug bundle collection the CLI was expanding the wrong error object, resulting in a panic since `err` is `nil`.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user