Skip to content

Commit

Permalink
Fix exception message (#16)
Browse files Browse the repository at this point in the history
* implement response validation

Signed-off-by: Anatoli Kalbasin <[email protected]>

* remove comments

Signed-off-by: Anatoli Kalbasin <[email protected]>

* add docs and update version

Signed-off-by: Anatoli Kalbasin <[email protected]>

* fix exception message

Signed-off-by: Anatoli Kalbasin <[email protected]>

* fix exception message

Signed-off-by: Anatoli Kalbasin <[email protected]>

---------

Signed-off-by: Anatoli Kalbasin <[email protected]>
Signed-off-by: Anatoli Kalbasin <[email protected]>
  • Loading branch information
callbacksin authored Apr 22, 2024
1 parent ce44b15 commit 8dd73e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/org/zowe/kotlinsdk/ResponseValidator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()}")
}
}
}

0 comments on commit 8dd73e4

Please sign in to comment.