2019-04-18 01:35:06 +08:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
class AbortError extends Error {
|
|
|
|
constructor () {
|
2019-04-18 15:47:47 +01:00
|
|
|
super('The operation was aborted')
|
2019-04-18 01:35:06 +08:00
|
|
|
this.code = AbortError.code
|
2019-04-18 18:44:17 +08:00
|
|
|
this.type = AbortError.type
|
2019-04-18 01:35:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static get code () {
|
|
|
|
return 'ABORT_ERR'
|
|
|
|
}
|
2019-04-18 18:44:17 +08:00
|
|
|
|
|
|
|
static get type () {
|
|
|
|
return 'aborted'
|
|
|
|
}
|
2019-04-18 01:35:06 +08:00
|
|
|
}
|
|
|
|
|
2019-04-19 10:20:56 +02:00
|
|
|
class AllListenersFailedError extends Error {
|
|
|
|
constructor () {
|
|
|
|
super('All listeners failed to listen on any addresses, please verify the addresses you provided are correct')
|
|
|
|
this.code = AllListenersFailedError.code
|
|
|
|
}
|
|
|
|
|
|
|
|
static get code () {
|
|
|
|
return 'ERR_ALL_LISTENERS_FAILED'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-18 01:35:06 +08:00
|
|
|
module.exports = {
|
2019-04-19 10:20:56 +02:00
|
|
|
AbortError,
|
|
|
|
AllListenersFailedError
|
2019-04-18 01:35:06 +08:00
|
|
|
}
|