Skip to content

Commit 4e5b9fb

Browse files
committed
Report saved warnings also when erroring out
1 parent 5f0de04 commit 4e5b9fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/cli/feedback/feedback.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func Fatal(errorMsg string, exitCode ExitCode) {
179179
Error string `json:"error"`
180180
Output *OutputStreamsResult `json:"output,omitempty"`
181181
}
182-
res := FatalError{
182+
res := &FatalError{
183183
Error: errorMsg,
184184
}
185185
if output := getOutputStreamResult(); !output.Empty() {
@@ -188,11 +188,11 @@ func Fatal(errorMsg string, exitCode ExitCode) {
188188
var d []byte
189189
switch format {
190190
case JSON:
191-
d, _ = json.MarshalIndent(res, "", " ")
191+
d, _ = json.MarshalIndent(augment(res), "", " ")
192192
case MinifiedJSON:
193-
d, _ = json.Marshal(res)
193+
d, _ = json.Marshal(augment(res))
194194
case YAML:
195-
d, _ = yaml.Marshal(res)
195+
d, _ = yaml.Marshal(augment(res))
196196
default:
197197
panic("unknown output format")
198198
}

0 commit comments

Comments
 (0)