diff --git a/lib/onelogin/api/cursor.rb b/lib/onelogin/api/cursor.rb index 0b5d248..bc63ad6 100644 --- a/lib/onelogin/api/cursor.rb +++ b/lib/onelogin/api/cursor.rb @@ -66,6 +66,8 @@ def fetch_next_page if json.nil? raise OneLogin::Api::ApiException.new("Response could not be parsed", 500) + elsif json.is_a?(String) + raise OneLogin::Api::ApiException.new(response.message, response.code) elsif !json.has_key?(@container) && json.has_key?('status') && json["status"]["error"] == true raise OneLogin::Api::ApiException.new(extract_error_message_from_response(response), json["status"]["code"]) elsif !json.has_key?(@container) && json.has_key?('statusCode')