exceptions in module

This commit is contained in:
Yuri Kuznetsov
2022-06-26 20:36:23 +03:00
parent 74abbe9cc0
commit 970b4ce104
3 changed files with 36 additions and 29 deletions
@@ -4,9 +4,7 @@
],
"developerModeScriptList": [
"client/src/loader.js",
"client/src/loader-init-libs.js",
"client/src/utils.js",
"client/src/exceptions.js"
"client/src/loader-init-libs.js"
],
"linkList": [
{
+4 -2
View File
@@ -59,7 +59,8 @@ define(
'ajax',
'number',
'page-title',
'broadcast-channel'
'broadcast-channel',
'exceptions'
],
function (
/** Espo */Espo,
@@ -92,7 +93,8 @@ function (
Ajax,
/** typeof module:number.Class */NumberUtil,
/** typeof module:page-title.Class */PageTitle,
/** typeof module:broadcast-channel.Class */BroadcastChannel
/** typeof module:broadcast-channel.Class */BroadcastChannel,
Exceptions
) {
/**
* A main application class.
+31 -24
View File
@@ -26,34 +26,41 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.Exceptions = Espo.Exceptions || {};
/**
* An access denied exception.
*
* @param {string} message A message.
* @class
* @module exceptions
*/
Espo.Exceptions.AccessDenied = function (message) {
this.message = message;
define('exceptions', [], function () {
Espo.Exceptions = Espo.Exceptions || {};
Error.apply(this, arguments);
};
/**
* An access denied exception.
*
* @param {string} message A message.
* @class
*/
Espo.Exceptions.AccessDenied = function (message) {
this.message = message;
Espo.Exceptions.AccessDenied.prototype = new Error();
Espo.Exceptions.AccessDenied.prototype.name = 'AccessDenied';
Error.apply(this, arguments);
};
/**
* A not found exception.
*
* @param {string} message A message.
* @class
*/
Espo.Exceptions.NotFound = function (message) {
this.message = message;
Espo.Exceptions.AccessDenied.prototype = new Error();
Espo.Exceptions.AccessDenied.prototype.name = 'AccessDenied';
Error.apply(this, arguments);
};
/**
* A not found exception.
*
* @param {string} message A message.
* @class
*/
Espo.Exceptions.NotFound = function (message) {
this.message = message;
Espo.Exceptions.NotFound.prototype = new Error();
Espo.Exceptions.NotFound.prototype.name = 'NotFound';
Error.apply(this, arguments);
};
Espo.Exceptions.NotFound.prototype = new Error();
Espo.Exceptions.NotFound.prototype.name = 'NotFound';
return Espo.Exceptions;
});