Fixed error reporting.
authorŁukasz Rekucki <lrekucki@gmail.com>
Fri, 16 Oct 2009 09:02:27 +0000 (11:02 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Fri, 16 Oct 2009 09:02:27 +0000 (11:02 +0200)
apps/api/handlers/library_handlers.py
platforma/static/js/app.js

index 2b1edb2..f7d5784 100644 (file)
@@ -628,6 +628,8 @@ class MergeHandler(BaseHandler):
             # update user document
             if changed:
                 user_doc_new = user_doc.latest()
             # 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
                 
             # 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()
             # 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
 
             # the user wersion is the same
             user_doc_new = base_doc
index e8b439d..8dae56e 100644 (file)
@@ -188,13 +188,16 @@ function parseXHRError(response)
       var json = $.evalJSON(response.responseText);
 
       if(json.reason == 'xml-parse-error') {
       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,
             "<a class='xml-editor-ref' href='#xml-$2-1'>$1$2$3</a>");
 
           message = message.replace(/(line\s+)(\d+)(\,\s*column\s+)(\d+)/i,
             "<a class='xml-editor-ref' href='#xml-$2-$4'>$1$2$3$4</a>");
       }
             "<a class='xml-editor-ref' href='#xml-$2-1'>$1$2$3</a>");
 
           message = message.replace(/(line\s+)(\d+)(\,\s*column\s+)(\d+)/i,
             "<a class='xml-editor-ref' href='#xml-$2-$4'>$1$2$3$4</a>");
       }
-      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;
     } catch(e) {
         // not a valid JSON response
         message = response.statusText;