mirror of
https://github.com/Dvorinka/ClubLogos.git
synced 2026-10-29 00:21:15 +00:00
fff
This commit is contained in:
1 parent
0fc92f8464
commit
cdb8bcd3e9
5928 files changed
+1054476
-72
No files matched your search
+32
@@ -0,0 +1,32 @@
|
||||
module.exports = class EventEmitterError extends Error {
|
||||
constructor(msg, code, fn = EventEmitterError, opts) {
|
||||
super(`${code}: ${msg}`, opts)
|
||||
this.code = code
|
||||
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, fn)
|
||||
}
|
||||
}
|
||||
|
||||
get name() {
|
||||
return 'EventEmitterError'
|
||||
}
|
||||
|
||||
static OPERATION_ABORTED(cause, msg = 'Operation aborted') {
|
||||
return new EventEmitterError(
|
||||
msg,
|
||||
'OPERATION_ABORTED',
|
||||
EventEmitterError.OPERATION_ABORTED,
|
||||
{ cause }
|
||||
)
|
||||
}
|
||||
|
||||
static UNHANDLED_ERROR(cause, msg = 'Unhandled error') {
|
||||
return new EventEmitterError(
|
||||
msg,
|
||||
'UNHANDLED_ERROR',
|
||||
EventEmitterError.UNHANDLED_ERROR,
|
||||
{ cause }
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user