Mercurial > lada > lada-client
diff 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 |
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);