UNPKG

protomux-rpc-client-pool

Version:

Reliably connect to one of a pool of protomux-rpc servers

21 lines (16 loc) 543 B
class ProtomuxRpcClientPoolError extends Error { constructor (msg, code, fn = ProtomuxRpcClientPoolError) { super(`${code}: ${msg}`) this.code = code if (Error.captureStackTrace) { Error.captureStackTrace(this, fn) } } get name () { return 'ProtomuxRpcClientPoolError' } static TOO_MANY_RETRIES () { return new ProtomuxRpcClientPoolError('Too many failed attempts to reach a server', 'TOO_MANY_RETRIES', ProtomuxRpcClientPoolError.TOO_MANY_RETRIES) } } module.exports = ProtomuxRpcClientPoolError