aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-04-22 17:14:15 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-04-22 17:14:15 +1200
commit8dc31f6bd7aa904a2709f67cf5deddd751f0407f (patch)
tree0433c7d0c9a0c0f82717d0f3d41eca88842a6673 /web
parent78c121fcb45c5fe5a6509c90898811d7e9d7a253 (diff)
downloadetbsa-traccar-web-8dc31f6bd7aa904a2709f67cf5deddd751f0407f.tar.gz
etbsa-traccar-web-8dc31f6bd7aa904a2709f67cf5deddd751f0407f.tar.bz2
etbsa-traccar-web-8dc31f6bd7aa904a2709f67cf5deddd751f0407f.zip
Improve generic error messages
Diffstat (limited to 'web')
-rw-r--r--web/app/Application.js16
-rw-r--r--web/l10n/en.json2
2 files changed, 10 insertions, 8 deletions
diff --git a/web/app/Application.js b/web/app/Application.js
index 1658e7d..d7a5bae 100644
--- a/web/app/Application.js
+++ b/web/app/Application.js
@@ -160,13 +160,15 @@ Ext.define('Traccar.Application', {
}
},
- showError: function (response) {
- if (Ext.isString(response)) {
- Ext.Msg.alert(Strings.errorTitle, response);
- } else if (response.responseText) {
- Ext.Msg.alert(Strings.errorTitle, response.responseText);
- } else if (response.statusText) {
- Ext.Msg.alert(Strings.errorTitle, response.statusText);
+ showError: function (error) {
+ if (Ext.isString(error)) {
+ Ext.Msg.alert(Strings.errorTitle, error);
+ } else if (error.responseText) {
+ Ext.Msg.alert(Strings.errorTitle, Strings.errorGeneral
+ + '<br><br><textarea readonly rows="5" style="resize: none; width: 100%;">'
+ + error.responseText + '</textarea>');
+ } else if (error.statusText) {
+ Ext.Msg.alert(Strings.errorTitle, error.statusText);
} else {
Ext.Msg.alert(Strings.errorTitle, Strings.errorConnection);
}
diff --git a/web/l10n/en.json b/web/l10n/en.json
index 075d230..230a2cc 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -75,7 +75,7 @@
"attributeMailSmtpUsername": "Mail: SMTP Username",
"attributeMailSmtpPassword": "Mail: SMTP Password",
"errorTitle": "Error",
- "errorUnknown": "Unknown error",
+ "errorGeneral": "Invalid parameters or constraints violation",
"errorConnection": "Connection error",
"errorSocket": "Web socket connection error",
"userEmail": "Email",