getCode(); if (is_int($errorCode) && $errorCode >= 400 && $errorCode < 600) { return $errorCode; } $status = $response->getStatusCode(); if ($status < 400 || $status >= 600) { $status = 500; } return $status; } }