From d04a61933efb08cfa786cafd7f1b1c4f6103e3e1 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Mar 2018 17:37:15 +0300 Subject: [PATCH] Show critical error with custom message. --- apps/documenteditor/main/app/controller/Main.js | 5 ++--- apps/presentationeditor/main/app/controller/Main.js | 4 ++-- apps/spreadsheeteditor/main/app/controller/Main.js | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 224187730..b972c2ca0 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1376,11 +1376,10 @@ define([ break; default: - config.msg = this.errorDefaultMessage.replace('%1', id); + config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; } - if (level == Asc.c_oAscError.Level.Critical) { // report only critical errors @@ -1389,7 +1388,7 @@ define([ config.title = this.criticalErrorTitle; config.iconCls = 'error'; - if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp) { + if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp && typeof id !== 'string') { config.msg += '

' + this.criticalErrorExtText; config.callback = function(btn) { if (btn == 'ok') diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 767673ad1..40d72c595 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1116,7 +1116,7 @@ define([ break; default: - config.msg = this.errorDefaultMessage.replace('%1', id); + config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; } @@ -1129,7 +1129,7 @@ define([ config.title = this.criticalErrorTitle; config.iconCls = 'error'; - if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp) { + if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp && typeof id !== 'string') { config.msg += '

' + this.criticalErrorExtText; config.fn = function(btn) { if (btn == 'ok') { diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index a9bd2e5df..416187f54 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1285,7 +1285,7 @@ define([ break; default: - config.msg = this.errorDefaultMessage.replace('%1', id); + config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; } @@ -1296,7 +1296,7 @@ define([ config.title = this.criticalErrorTitle; config.iconCls = 'error'; - if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp) { + if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp && typeof id !== 'string') { config.msg += '

' + this.criticalErrorExtText; config.callback = function(btn) { if (btn == 'ok') {