@nu-art/ts-common 0.200.131 → 0.200.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/exceptions.d.ts +1 -0
- package/core/exceptions.js +16 -1
- package/package.json +1 -1
package/core/exceptions.d.ts
CHANGED
package/core/exceptions.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* Created by TacB0sS on 3/16/17.
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.AssertionException = exports.WhoCallthisException = exports.DontCallthisException = exports.HasDependenciesException = exports.ThisShouldNotHappenException = exports.NotImplementedYetException = exports.MUSTNeverHappenException = exports.ImplementationMissingException = exports.BadImplementationException = exports.Exception = exports.CustomException = exports.isErrorOfType = void 0;
|
|
23
|
+
exports.isCustomException = exports.AssertionException = exports.WhoCallthisException = exports.DontCallthisException = exports.HasDependenciesException = exports.ThisShouldNotHappenException = exports.NotImplementedYetException = exports.MUSTNeverHappenException = exports.ImplementationMissingException = exports.BadImplementationException = exports.Exception = exports.CustomException = exports.isErrorOfType = void 0;
|
|
24
24
|
/**
|
|
25
25
|
* # <ins>isErrorOfType</ins>
|
|
26
26
|
*
|
|
@@ -192,3 +192,18 @@ class AssertionException extends CustomException {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
exports.AssertionException = AssertionException;
|
|
195
|
+
const allExceptions = [
|
|
196
|
+
Exception,
|
|
197
|
+
BadImplementationException,
|
|
198
|
+
ImplementationMissingException,
|
|
199
|
+
MUSTNeverHappenException,
|
|
200
|
+
NotImplementedYetException,
|
|
201
|
+
ThisShouldNotHappenException,
|
|
202
|
+
DontCallthisException,
|
|
203
|
+
WhoCallthisException,
|
|
204
|
+
AssertionException,
|
|
205
|
+
];
|
|
206
|
+
function isCustomException(e) {
|
|
207
|
+
return allExceptions.some(exc => !!isErrorOfType(e, exc));
|
|
208
|
+
}
|
|
209
|
+
exports.isCustomException = isCustomException;
|