From: Łukasz Rekucki Date: Fri, 16 Oct 2009 09:02:27 +0000 (+0200) Subject: Fixed error reporting. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/dbd31e1486a3f2a94cb6828ee5ceb7dee783091f Fixed error reporting. --- 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;