forked from libp2p/js-libp2p-interfaces
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherrors.js
40 lines (33 loc) · 845 Bytes
/
errors.js
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
35
36
37
38
39
40
'use strict'
class UnexpectedPeerError extends Error {
constructor (message = 'Unexpected Peer') {
super(message)
this.code = UnexpectedPeerError.code
}
static get code () {
return 'ERR_UNEXPECTED_PEER'
}
}
class InvalidCryptoExchangeError extends Error {
constructor (message = 'Invalid crypto exchange') {
super(message)
this.code = InvalidCryptoExchangeError.code
}
static get code () {
return 'ERR_INVALID_CRYPTO_EXCHANGE'
}
}
class InvalidCryptoTransmissionError extends Error {
constructor (message = 'Invalid crypto transmission') {
super(message)
this.code = InvalidCryptoTransmissionError.code
}
static get code () {
return 'ERR_INVALID_CRYPTO_TRANSMISSION'
}
}
module.exports = {
UnexpectedPeerError,
InvalidCryptoExchangeError,
InvalidCryptoTransmissionError
}