From 8dd73e4a7c3bab70bc3f19b198f8dae3824c77fe Mon Sep 17 00:00:00 2001 From: Anatoli Kalbasin <37359814+callbacksin@users.noreply.github.com> Date: Mon, 22 Apr 2024 18:47:04 +0300 Subject: [PATCH] Fix exception message (#16) * implement response validation Signed-off-by: Anatoli Kalbasin * remove comments Signed-off-by: Anatoli Kalbasin * add docs and update version Signed-off-by: Anatoli Kalbasin * fix exception message Signed-off-by: Anatoli Kalbasin * fix exception message Signed-off-by: Anatoli Kalbasin --------- Signed-off-by: Anatoli Kalbasin Signed-off-by: Anatoli Kalbasin <37359814+callbacksin@users.noreply.github.com> --- src/main/kotlin/org/zowe/kotlinsdk/ResponseValidator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/zowe/kotlinsdk/ResponseValidator.kt b/src/main/kotlin/org/zowe/kotlinsdk/ResponseValidator.kt index 0a57450e..6267cb06 100644 --- a/src/main/kotlin/org/zowe/kotlinsdk/ResponseValidator.kt +++ b/src/main/kotlin/org/zowe/kotlinsdk/ResponseValidator.kt @@ -16,7 +16,7 @@ fun validateResponse(response: Response<*>?, defaultMessage: String = "") { if (response?.errorBody()?.string().isNullOrBlank()) { throw Exception("HTTP code = ${response?.code()}; Message: ${response?.message()}") } else { - throw Exception("${if (defaultMessage.isBlank()) "" else "$defaultMessage. "}${response?.errorBody()}") + throw Exception("${if (defaultMessage.isBlank()) "" else "$defaultMessage. "}${response?.errorBody()?.string()}") } } } \ No newline at end of file