Skip to content

Commit 7f0c7bf

Browse files
committed
parse Body instead of ErrorMessage field in IsTooManyDevicesError()
Signed-off-by: Niclas Schad <niclas.schad@stackit.cloud>
1 parent e6e983c commit 7f0c7bf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/stackit/stackiterrors/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func IsTooManyDevicesError(err error) bool {
2929

3030
// TODO: Improve this if possible
3131
return oAPIError.StatusCode == http.StatusForbidden &&
32-
strings.Contains(oAPIError.ErrorMessage, "maximum allowed number of disk devices")
32+
strings.Contains(string(oAPIError.Body), "maximum allowed number of disk devices")
3333
}
3434

3535
func IgnoreNotFound(err error) error {

0 commit comments

Comments
 (0)