-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherrors.js
More file actions
34 lines (28 loc) · 898 Bytes
/
errors.js
File metadata and controls
34 lines (28 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict'
class CannotOpenLogError extends Error {
constructor (message = 'can not open log') {
super(message)
this.name = 'CannotOpenLogError'
this.code = CannotOpenLogError.code
}
}
CannotOpenLogError.code = 'ERR_CAN_NOT_OPEN_LOG'
exports.CannotOpenLogError = CannotOpenLogError
class InvalidEntryTypeError extends Error {
constructor (message = 'invalid entry type') {
super(message)
this.name = 'InvalidEntryTypeError'
this.code = InvalidEntryTypeError.code
}
}
InvalidEntryTypeError.code = 'INVALID_ENTRY_TYPE'
exports.InvalidEntryTypeError = InvalidEntryTypeError
class DuplicateEntryError extends Error {
constructor (message = 'duplicate entry') {
super(message)
this.name = 'DuplicateEntryError'
this.code = DuplicateEntryError.code
}
}
DuplicateEntryError.code = 'DUPLICATE_ENTRY'
exports.DuplicateEntryError = DuplicateEntryError