diff --git a/common/apiBase.js b/common/apiBase.js index 8e98493f5c..c836d11b47 100644 --- a/common/apiBase.js +++ b/common/apiBase.js @@ -1927,7 +1927,8 @@ }; this.CoAuthoringApi.onWarning = function(code) { - t.sendEvent('asc_onError', code || c_oAscError.ID.Warning, c_oAscError.Level.NoCritical); + const error = undefined !== code ? AscCommon.mapAscServerErrorToAscError(code) : c_oAscError.ID.Warning; + t.sendEvent('asc_onError', error, c_oAscError.Level.NoCritical); }; this.CoAuthoringApi.onMeta = function(data) { diff --git a/common/docscoapi.js b/common/docscoapi.js index a67a4826a9..9b1ed75744 100644 --- a/common/docscoapi.js +++ b/common/docscoapi.js @@ -1102,7 +1102,7 @@ } else if (code === c_oAscServerCommandErrors.NotModified) { this.onForceSave({type: c_oAscForceSaveTypes.Button, refuse: true}); } else { - this.onWarning(Asc.c_oAscError.ID.Unknown); + this.onWarning(AscCommon.c_oAscServerError.Unknown); } }; DocsCoApi.prototype._onForceSave = function(data) { @@ -1512,7 +1512,7 @@ }; DocsCoApi.prototype._onWarning = function(data) { - this.onWarning(Asc.c_oAscError.ID.Warning); + this.onWarning(data.code); }; DocsCoApi.prototype._onLicense = function(data) { diff --git a/common/editorscommon.js b/common/editorscommon.js index b433683f97..c1dd9d697f 100644 --- a/common/editorscommon.js +++ b/common/editorscommon.js @@ -1119,6 +1119,9 @@ case c_oAscServerError.ChangeDocInfo : nRes = Asc.c_oAscError.ID.AccessDeny; break; + case c_oAscServerError.ForcedViewMode : + nRes = Asc.c_oAscError.ID.ForcedViewMode; + break; case c_oAscServerError.Storage : case c_oAscServerError.StorageFileNoFound : case c_oAscServerError.StorageRead : @@ -1716,7 +1719,9 @@ VKeyKeyExpire: -122, VKeyUserCountExceed: -123, - Password: -180 + Password: -180, + + ForcedViewMode: -200 }; //todo get from server config @@ -15444,6 +15449,7 @@ window["AscCommon"].openFileCommand = openFileCommand; window["AscCommon"].sendCommand = sendCommand; window["AscCommon"].sendSaveFile = sendSaveFile; + window["AscCommon"].c_oAscServerError = c_oAscServerError; window["AscCommon"].mapAscServerErrorToAscError = mapAscServerErrorToAscError; window["AscCommon"].joinUrls = joinUrls; window["AscCommon"].getFullImageSrc2 = getFullImageSrc2; diff --git a/common/errorCodes.js b/common/errorCodes.js index ad3beadf02..38bd5b09c1 100644 --- a/common/errorCodes.js +++ b/common/errorCodes.js @@ -136,6 +136,7 @@ UserDrop : -100, Warning : -101, UpdateVersion : -102, + ForcedViewMode : -103, PrintMaxPagesCount : -110,