UNPKG

488 BPlain TextView Raw
1import { makeErrorWithCode } from '@neo-one/utils-esnext-esm';
2import { Message } from './Message';
3
4export 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
12export const AlreadyConnectedError = makeErrorWithCode(
13 'ALREADY_CONNECTED',
14 (reason: string) => `Negotiation failed: ${reason}`,
15);
16
\No newline at end of file