added whole system from ola4doc

This commit is contained in:
Bachir Soussi Chiadmi
2017-12-14 17:06:06 +01:00
parent 9646c74be1
commit 0611418f7a
8725 changed files with 817688 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = {
throw: require('./throw')
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
var error = require('../valid-error');
module.exports = function () { throw error(this); };
+20
View File
@@ -0,0 +1,20 @@
'use strict';
var assign = require('../object/assign')
, captureStackTrace = Error.captureStackTrace;
exports = module.exports = function (message/*, code, ext*/) {
var err = new Error(), code = arguments[1], ext = arguments[2];
if (ext == null) {
if (code && (typeof code === 'object')) {
ext = code;
code = null;
}
}
if (ext != null) assign(err, ext);
err.message = String(message);
if (code != null) err.code = String(code);
if (captureStackTrace) captureStackTrace(err, exports);
return err;
};
+8
View File
@@ -0,0 +1,8 @@
'use strict';
module.exports = {
'#': require('./#'),
custom: require('./custom'),
isError: require('./is-error'),
validError: require('./valid-error')
};
+9
View File
@@ -0,0 +1,9 @@
'use strict';
var toString = Object.prototype.toString
, id = toString.call(new Error());
module.exports = function (x) {
return (x && ((x instanceof Error) || (toString.call(x)) === id)) || false;
};
+8
View File
@@ -0,0 +1,8 @@
'use strict';
var isError = require('./is-error');
module.exports = function (x) {
if (!isError(x)) throw new TypeError(x + " is not an Error object");
return x;
};