changeset 696:b0f1dcdf981d

Made the unhandled Errors more talkativew
author Dustin Demuth <dustin@intevation.de>
date Thu, 26 Mar 2015 16:26:24 +0100
parents d6ef146e1a9f
children 5b2cbc6bc39a
files app/view/window/MessungEdit.js app/view/window/ProbeEdit.js
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/window/MessungEdit.js	Thu Mar 26 16:24:13 2015 +0100
+++ b/app/view/window/MessungEdit.js	Thu Mar 26 16:26:24 2015 +0100
@@ -98,8 +98,10 @@
         this.clearMessages();
         var that = this;
         Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), {
-            failure: function(record) {
+            failure: function(record, response) {
                 // TODO
+                console.log("An unhandled Failure occured. See following Response and Record");
+                console.log(response);
                 console.log(record);
             },
             success: function(record, response) {
@@ -107,7 +109,10 @@
                 if (this.probe.get('treeModified') < record.get('treeModified')) {
                     Ext.Msg.show({
                         title: 'Probe nicht aktuell!',
-                        msg: 'Die zugehörige Probe wurde verändert.\nMöchten Sie zu der Probe zurückkehren und neu laden?\nOhne das erneute Laden der Probe wird das Speichern der Messung nicht möglich sein.',
+                        msg: 'Die zugehörige Probe wurde verändert.\n'+
+                            'Möchten Sie zu der Probe zurückkehren und neu laden?\n'+
+                            'Ohne das erneute Laden der Probe wird das Speichern'+
+                            ' der Messung nicht möglich sein.',
                         buttons: Ext.Msg.OKCANCEL,
                         icon: Ext.Msg.WARNING,
                         closable: false,
@@ -132,7 +137,6 @@
             },
             scope: this
         });
-        console.log(this.record);
         if (this.record.get('readonly') == true){
             this.disableForm();
         }
--- a/app/view/window/ProbeEdit.js	Thu Mar 26 16:24:13 2015 +0100
+++ b/app/view/window/ProbeEdit.js	Thu Mar 26 16:26:24 2015 +0100
@@ -112,7 +112,10 @@
         Ext.ClassManager.get('Lada.model.Probe').load(this.record.get('id'), {
             failure: function(record, action) {
                 // TODO
-            },
+                console.log("An unhandled Failure occured. See following Response and Record");
+                console.log(response);
+                console.log(record);
+             },
             success: function(record, response) {
                 this.down('probeform').setRecord(record);
                 this.record = record;
@@ -131,6 +134,8 @@
 
             //The Owner of a Probe is always allowed to add a Messung.
             // ToDo ist it required to check if a Status exists?
+            // ToDo this doesn't work here because the owner is unknown when this code
+            //   is executed.
             if (this.record.get('owner') == true){
                 //allow to add Messungen
                 this.down('fset[name=messungen]').down('messunggrid').down('button[name=add]').enable();

http://lada.wald.intevation.org