aboutsummaryrefslogtreecommitdiff
path: root/web/app/Application.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/Application.js')
-rw-r--r--web/app/Application.js30
1 files changed, 8 insertions, 22 deletions
diff --git a/web/app/Application.js b/web/app/Application.js
index 5cc192686..fc4344a08 100644
--- a/web/app/Application.js
+++ b/web/app/Application.js
@@ -20,7 +20,6 @@ Ext.define('Traccar.Application', {
requires: [
'Traccar.Style',
- 'Traccar.ErrorManager',
'Traccar.AttributeFormatter'
],
@@ -79,33 +78,20 @@ Ext.define('Traccar.Application', {
},
showError: function (response) {
+ var data;
if (Ext.isString(response)) {
Ext.Msg.alert(Strings.errorTitle, response);
+ } else if (response.responseText) {
+ data = Ext.decode(response.responseText);
+ if (data.details) {
+ Ext.Msg.alert(Strings.errorTitle, data.details);
+ } else {
+ Ext.Msg.alert(Strings.errorTitle, data.message);
+ }
} else if (response.statusText) {
Ext.Msg.alert(Strings.errorTitle, response.statusText);
} else {
Ext.Msg.alert(Strings.errorTitle, Strings.errorConnection);
}
- },
-
- getErrorHandler: function (scope, handler) {
- return function (options, success, response) {
- var result;
- if (success) {
- result = Ext.decode(response.responseText);
- if (!result.success) {
- Ext.Msg.alert(Strings.errorTitle, result.error);
- }
- if (handler) {
- handler.call(scope, options, success, response);
- }
- } else {
- if (response.statusText) {
- Ext.Msg.alert(Strings.errorTitle, response.statusText);
- } else {
- Ext.Msg.alert(Strings.errorTitle, Strings.errorConnection);
- }
- }
- };
}
});