From dbd31e1486a3f2a94cb6828ee5ceb7dee783091f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Fri, 16 Oct 2009 11:02:27 +0200 Subject: [PATCH] Fixed error reporting. --- apps/api/handlers/library_handlers.py | 4 ++++ platforma/static/js/app.js | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/api/handlers/library_handlers.py b/apps/api/handlers/library_handlers.py index 2b1edb21..f7d57849 100644 --- a/apps/api/handlers/library_handlers.py +++ b/apps/api/handlers/library_handlers.py @@ -628,6 +628,8 @@ class MergeHandler(BaseHandler): # update user document if changed: user_doc_new = user_doc.latest() + else: + user_doc_new = user_doc # shared document is the same doc_new = doc @@ -680,6 +682,8 @@ class MergeHandler(BaseHandler): # update shared version if needed if changed: doc_new = doc.latest() + else: + doc_new = doc # the user wersion is the same user_doc_new = base_doc diff --git a/platforma/static/js/app.js b/platforma/static/js/app.js index e8b439df..8dae56e4 100644 --- a/platforma/static/js/app.js +++ b/platforma/static/js/app.js @@ -188,13 +188,16 @@ function parseXHRError(response) var json = $.evalJSON(response.responseText); if(json.reason == 'xml-parse-error') { - message = json_response.message.replace(/(line\s+)(\d+)(\s+)/i, + message = json.message.replace(/(line\s+)(\d+)(\s+)/i, "$1$2$3"); message = message.replace(/(line\s+)(\d+)(\,\s*column\s+)(\d+)/i, "$1$2$3$4"); } - message = json_response.message || json_response.reason || "Nieznany błąd :(("; + else { + message = json.message || json.reason || "Nieznany błąd :(("; + } + } catch(e) { // not a valid JSON response message = response.statusText; -- 2.20.1