1 | import { makeErrorWithCode } from '@neo-one/utils-esnext-esm';
|
2 | import { Message } from './Message';
|
3 |
|
4 | export const NegotiationError = makeErrorWithCode(
|
5 | 'NEGOTIATION',
|
6 | (message: Message, reason?: string) =>
|
7 | `Negotiation failed. Unexpected message received: ${message.value.command}${
|
8 | reason === undefined ? '' : `. ${reason}`
|
9 | }`,
|
10 | );
|
11 |
|
12 | export const AlreadyConnectedError = makeErrorWithCode(
|
13 | 'ALREADY_CONNECTED',
|
14 | (reason: string) => `Negotiation failed: ${reason}`,
|
15 | );
|
16 |
|
\ | No newline at end of file |