initial commit
[urlittler] / src / errors.js
1 'use strict';
2
3 const { Errors } = require('@squeep/api-dingus');
4
5 class DatabaseError extends Errors.DingusError {
6 constructor(...args) {
7 super(...args);
8 Error.captureStackTrace(DatabaseError);
9 }
10 }
11
12 class ServeStaticFile extends Errors.DingusError {
13 constructor(file, ...args) {
14 super(...args);
15 this.file = file;
16 delete this.stack;
17 }
18 }
19
20 class SlugGeneratorExhausted extends Errors.DingusError {
21 constructor(...args) {
22 super(...args);
23 }
24 }
25
26 module.exports = {
27 ...Errors,
28 DatabaseError,
29 ServeStaticFile,
30 SlugGeneratorExhausted,
31 };