forked from mpetrunic/js-libp2p-interfaces
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherrors.ts
39 lines (30 loc) · 814 Bytes
/
errors.ts
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
export class UnexpectedPeerError extends Error {
public code: string
constructor (message = 'Unexpected Peer') {
super(message)
this.code = UnexpectedPeerError.code
}
static get code () {
return 'ERR_UNEXPECTED_PEER'
}
}
export class InvalidCryptoExchangeError extends Error {
public code: string
constructor (message = 'Invalid crypto exchange') {
super(message)
this.code = InvalidCryptoExchangeError.code
}
static get code () {
return 'ERR_INVALID_CRYPTO_EXCHANGE'
}
}
export class InvalidCryptoTransmissionError extends Error {
public code: string
constructor (message = 'Invalid crypto transmission') {
super(message)
this.code = InvalidCryptoTransmissionError.code
}
static get code () {
return 'ERR_INVALID_CRYPTO_TRANSMISSION'
}
}