From b4657196fba53b39e25638dff96241bca1ebbc2b Mon Sep 17 00:00:00 2001 From: Ramanth Date: Tue, 6 Aug 2019 22:17:18 +0530 Subject: [PATCH 1/3] feat(r): handling error response for 3xx cases --- .../src/main/resources/r/api.mustache | 16 ++++++++++++++++ samples/client/petstore/R/R/pet_api.R | 16 ++++++++++++++++ samples/client/petstore/R/R/store_api.R | 8 ++++++++ samples/client/petstore/R/R/user_api.R | 16 ++++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 04fd3634e38d..f0ee8fd8688c 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -291,6 +291,22 @@ {{! Returning the ApiResponse object with NULL object when the endpoint doesn't return anything}} ApiResponse$new(NULL, resp) {{/returnType}} + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + {{#returnExceptionOnFailure}} + errorMsg <- toString(content(resp)) + if(errorMsg == ""){ + errorMsg <- "Api resource exception encountered." + } + {{#useDefaultExceptionHandling}} + stop(errorMsg) + {{/useDefaultExceptionHandling}} + {{#useRlangExceptionHandling}} + rlang::abort(message = errorMsg, .subclass = "ApiException", ApiException = ApiException$new(http_response = resp)) + {{/useRlangExceptionHandling}} + {{/returnExceptionOnFailure}} + {{^returnExceptionOnFailure}} + ApiResponse$new("API resource error", resp) + {{/returnExceptionOnFailure}} } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { {{#returnExceptionOnFailure}} errorMsg <- toString(content(resp)) diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 3bc7bfafb390..52867100335a 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -371,6 +371,8 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -417,6 +419,8 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -465,6 +469,8 @@ PetApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -513,6 +519,8 @@ PetApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -565,6 +573,8 @@ PetApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -611,6 +621,8 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -660,6 +672,8 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -715,6 +729,8 @@ PetApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index 7e066a32e948..f4b5253f1ea3 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -210,6 +210,8 @@ StoreApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -254,6 +256,8 @@ StoreApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -302,6 +306,8 @@ StoreApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -352,6 +358,8 @@ StoreApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index b130324b3469..2cd62f47ddd3 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -329,6 +329,8 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -374,6 +376,8 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -419,6 +423,8 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -461,6 +467,8 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -509,6 +517,8 @@ UserApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -561,6 +571,8 @@ UserApi <- R6::R6Class( } ) ApiResponse$new(deserializedRespObj, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -595,6 +607,8 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -647,6 +661,8 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) + } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { + ApiResponse$new("API resource error", resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { From b7943b337e3c4e0c46e94ac81f3c8c25253f7cdc Mon Sep 17 00:00:00 2001 From: Veda Bhaskara Ramanth Addala Date: Sat, 24 Aug 2019 09:44:43 +0530 Subject: [PATCH 2/3] fix(r) : changed the message for 3XX case --- modules/openapi-generator/src/main/resources/r/api.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index f0ee8fd8688c..c79ebf710484 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -295,7 +295,7 @@ {{#returnExceptionOnFailure}} errorMsg <- toString(content(resp)) if(errorMsg == ""){ - errorMsg <- "Api resource exception encountered." + errorMsg <- paste("Server returned " , httr::status_code(resp) , " response status code.") } {{#useDefaultExceptionHandling}} stop(errorMsg) From 3e6ca350fa69629635164ac5658088ede0fdf172 Mon Sep 17 00:00:00 2001 From: Veda Bhaskara Ramanth Addala Date: Sat, 24 Aug 2019 09:59:02 +0530 Subject: [PATCH 3/3] fix(r) : fixing the status code 3xx --- .../src/main/resources/r/api.mustache | 2 +- samples/client/petstore/R/R/pet_api.R | 16 ++++++++-------- samples/client/petstore/R/R/store_api.R | 8 ++++---- samples/client/petstore/R/R/user_api.R | 16 ++++++++-------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index c79ebf710484..7f21323c95f7 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -305,7 +305,7 @@ {{/useRlangExceptionHandling}} {{/returnExceptionOnFailure}} {{^returnExceptionOnFailure}} - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) {{/returnExceptionOnFailure}} } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { {{#returnExceptionOnFailure}} diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 52867100335a..7b653e00c9bb 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -372,7 +372,7 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -420,7 +420,7 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -470,7 +470,7 @@ PetApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -520,7 +520,7 @@ PetApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -574,7 +574,7 @@ PetApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -622,7 +622,7 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -673,7 +673,7 @@ PetApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -730,7 +730,7 @@ PetApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index f4b5253f1ea3..e15d156052c6 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -211,7 +211,7 @@ StoreApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -257,7 +257,7 @@ StoreApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -307,7 +307,7 @@ StoreApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -359,7 +359,7 @@ StoreApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index 2cd62f47ddd3..f6a685f4de86 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -330,7 +330,7 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -377,7 +377,7 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -424,7 +424,7 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -468,7 +468,7 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -518,7 +518,7 @@ UserApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -572,7 +572,7 @@ UserApi <- R6::R6Class( ) ApiResponse$new(deserializedRespObj, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -608,7 +608,7 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) { @@ -662,7 +662,7 @@ UserApi <- R6::R6Class( if (httr::status_code(resp) >= 200 && httr::status_code(resp) <= 299) { ApiResponse$new(NULL, resp) } else if (httr::status_code(resp) >= 300 && httr::status_code(resp) <= 399) { - ApiResponse$new("API resource error", resp) + ApiResponse$new(paste("Server returned " , httr::status_code(resp) , " response status code."), resp) } else if (httr::status_code(resp) >= 400 && httr::status_code(resp) <= 499) { ApiResponse$new("API client error", resp) } else if (httr::status_code(resp) >= 500 && httr::status_code(resp) <= 599) {