changeset 855:dff2798390f8

Better Error handling
author Dustin Demuth <dustin@intevation.de>
date Fri, 10 Jul 2015 14:21:59 +0200
parents a031b98c7edc
children e44070aa45d2
files app/view/window/GenProbenFromMessprogramm.js
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/window/GenProbenFromMessprogramm.js	Fri Jul 10 10:20:13 2015 +0200
+++ b/app/view/window/GenProbenFromMessprogramm.js	Fri Jul 10 14:21:59 2015 +0200
@@ -69,7 +69,14 @@
                         });
                     },
                     failure: function(response) {
-                        var json = Ext.JSON.decode(response.responseText);
+                        var json = null;
+                        try {
+                            json = Ext.JSON.decode(response.responseText);
+                        }
+                        catch(err){
+                            Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title'),
+                                Lada.getApplication().bundle.getMsg('err.msg.response.body'));
+                        }
                         if (json) {
                             if(json.errors.totalCount > 0 || json.warnings.totalCount > 0){
                                 formPanel.setMessages(json.errors, json.warnings);

http://lada.wald.intevation.org