diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-03-19 16:37:18 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-03-19 16:37:18 +0100 |
commit | 61649cb1b34771b3f7d9ae996040dec32c4a01c6 (patch) | |
tree | 7925f143ec978b97d433ecf1af238ea31b481c86 | |
parent | 11b9c93cbcdb35ce6b5c0827ccbe58fd36959b9e (diff) | |
download | kvision-61649cb1b34771b3f7d9ae996040dec32c4a01c6.tar.gz kvision-61649cb1b34771b3f7d9ae996040dec32c4a01c6.tar.bz2 kvision-61649cb1b34771b3f7d9ae996040dec32c4a01c6.zip |
Better error handling in CallAgent
-rw-r--r-- | kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt index eb88ba8b..1a9460f2 100644 --- a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt +++ b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt @@ -86,6 +86,8 @@ open class CallAgent { { xhr: JQueryXHR, _: String, errorText: String -> val message = if (xhr.responseJSON != null && xhr.responseJSON != undefined) { xhr.responseJSON.toString() + } else if (xhr.responseText != undefined) { + xhr.responseText } else { errorText } @@ -130,6 +132,8 @@ open class CallAgent { { xhr: JQueryXHR, _: String, errorText: String -> val message = if (xhr.responseJSON != null && xhr.responseJSON != undefined) { NativeJSON.stringify(xhr.responseJSON) + } else if (xhr.responseText != undefined) { + xhr.responseText } else { errorText } |