diff options
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index ac4e4c9e..45ed6be8 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -472,8 +472,11 @@ function onConnectFail(f) { connectHandlers = cons(flift(f), connectHandlers); } -function conn() { - runHandlers("Connect", connectHandlers, null); +function conn(msg) { + var rx = /(.*)<body>((.|\n|\r)*)<\/body>(.*)/g; + var arr = rx.exec(msg); + msg = (arr && arr.length >= 3) ? arr[2] : msg; + runHandlers("RPC failure", connectHandlers, msg); } var serverHandlers = null; @@ -1595,7 +1598,7 @@ function rc(prefix, uri, parse, k, needsSig, isN) { } } else { if (isN == null) - conn(); + conn(xhr.responseText); else k(null); } |