aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-02-16 02:38:56 +0100
committerRobert Jaros <rjaros@finn.pl>2019-02-16 02:38:56 +0100
commitf1bbb0293b795f192fdef6e3ac8fc465232838d1 (patch)
tree5832d2e3a0e3783e9d8cf136d75576510f8d4ec3 /kvision-modules
parent6af4d5e3b0d268f9353798686684155816a66a2f (diff)
downloadkvision-f1bbb0293b795f192fdef6e3ac8fc465232838d1.tar.gz
kvision-f1bbb0293b795f192fdef6e3ac8fc465232838d1.tar.bz2
kvision-f1bbb0293b795f192fdef6e3ac8fc465232838d1.zip
Fix for exception message handling.
Diffstat (limited to 'kvision-modules')
-rw-r--r--kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt3
1 files changed, 2 insertions, 1 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 53e612c6..686d955b 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
@@ -34,6 +34,7 @@ import pl.treksoft.kvision.utils.JSON
import pl.treksoft.kvision.utils.JSON.toObj
import pl.treksoft.kvision.utils.obj
import kotlin.js.Promise
+import kotlin.js.JSON as NativeJSON
/**
* HTTP status unauthorized (401).
@@ -127,7 +128,7 @@ open class CallAgent {
this.error =
{ xhr: JQueryXHR, _: String, errorText: String ->
val message = if (xhr.responseJSON != null && xhr.responseJSON != undefined) {
- xhr.responseJSON.toString()
+ NativeJSON.stringify(xhr.responseJSON)
} else {
errorText
}