comparison app/view/window/GenProbenFromMessprogramm.js @ 855:dff2798390f8

Better Error handling
author Dustin Demuth <dustin@intevation.de>
date Fri, 10 Jul 2015 14:21:59 +0200
parents 2214aea9fd3a
children 6249b731d438 03f39ddae596
comparison
equal deleted inserted replaced
854:a031b98c7edc 855:dff2798390f8
67 msg: me.evalResponse(json), 67 msg: me.evalResponse(json),
68 buttons: Ext.Msg.OK, 68 buttons: Ext.Msg.OK,
69 }); 69 });
70 }, 70 },
71 failure: function(response) { 71 failure: function(response) {
72 var json = Ext.JSON.decode(response.responseText); 72 var json = null;
73 try {
74 json = Ext.JSON.decode(response.responseText);
75 }
76 catch(err){
77 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
78 Lada.getApplication().bundle.getMsg('err.msg.response.body'));
79 }
73 if (json) { 80 if (json) {
74 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){ 81 if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){
75 formPanel.setMessages(json.errors, json.warnings); 82 formPanel.setMessages(json.errors, json.warnings);
76 } 83 }
77 // TODO Move this handling of 699 and 698 to a more central place! 84 // TODO Move this handling of 699 and 698 to a more central place!

http://lada.wald.intevation.org