Skip to content

Commit 08ba83a

Browse files
committed
Return whatever it's contained in detail
1 parent fdf5d95 commit 08ba83a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/iot/error.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ func errorDetail(err error) error {
4141
if bodyErr := json.Unmarshal(apiErr.Body(), &body); bodyErr != nil {
4242
return err
4343
}
44-
if detail, ok := body["detail"]; ok {
45-
return fmt.Errorf("%w: %s", err, detail)
44+
detail, ok := body["detail"]
45+
if !ok {
46+
return err
4647
}
47-
48-
return err
48+
return fmt.Errorf("%w: %v", err, detail)
4949
}

0 commit comments

Comments
 (0)