From 831a7b81004c0456c317ef4c521cbebd4cbf5fc2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 2 Dec 2015 11:07:11 +1300 Subject: Start web app migration to REST API --- web/app/Application.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'web/app/Application.js') diff --git a/web/app/Application.js b/web/app/Application.js index ebf685dbc..34d65d13a 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -78,6 +78,14 @@ Ext.define('Traccar.Application', { return this.getUser().get(key) || this.getServer().get(key) || defaultValue; }, + showError: function (response) { + 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; -- cgit v1.2.3