Merge branch 'v1.3-dev' as v1.3.11
[websub-hub] / src / errors.js
1 'use strict';
2
3 const { Errors } = require('@squeep/api-dingus');
4
5 class DatabaseError extends Error {
6 constructor(...args) {
7 super(...args);
8 Error.captureStackTrace(DatabaseError);
9 }
10
11 get name() {
12 /* istanbul ignore next */
13 return this.constructor.name;
14 }
15 }
16
17 class InternalInconsistencyError extends Error {
18 constructor(...args) {
19 super(...args);
20 Error.captureStackTrace(InternalInconsistencyError);
21 }
22
23 get name() {
24 /* istanbul ignore next */
25 return this.constructor.name;
26 }
27 }
28
29 module.exports = {
30 ...Errors,
31 DatabaseError,
32 InternalInconsistencyError,
33 };