From 91c74f7e89ec610288f473c3b5e5b48a37b1b42b Mon Sep 17 00:00:00 2001 From: Giulio Cesare Solaroli Date: Tue, 24 Nov 2015 19:28:24 +0100 Subject: [PATCH] Fixed Connection error handling --- frontend/delta/js/Clipperz/PM/Connection.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/delta/js/Clipperz/PM/Connection.js b/frontend/delta/js/Clipperz/PM/Connection.js index 3b16568..57076ee 100644 --- a/frontend/delta/js/Clipperz/PM/Connection.js +++ b/frontend/delta/js/Clipperz/PM/Connection.js @@ -493,14 +493,18 @@ Clipperz.log(">>> Connection.messageExceptionHandler: " + anError.message, anEr if (anError instanceof MochiKit.Async.CancelledError) { result = anError; } else { - if ((anError.message == 'Trying to communicate without an active connection') || - (anError.message == 'No tollManager available for current session') + var errorPayload; + + errorPayload = Clipperz.Base.evalJSON(anError.req.responseText); + if ((errorPayload.message == 'Trying to communicate without an active connection') || + (errorPayload.message == 'No tollManager available for current session') || + (errorPayload.message == 'HashCash verification failed. The provided toll is not valid.') ) { result = this.reestablishConnection(anOriginalMessageArguments); - } else if (anError.message == 'Session with stale data') { + } else if (errorPayload.message == 'Session with stale data') { MochiKit.Signal.signal(this, 'EXCEPTION'); } else { - result = anError; + result = errorPayload; } } Clipperz.log("<<< Connection.messageExceptionHandler")