From c93bb4ef9829f9c8467dea198a4520224cb687f5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 5 Dec 2017 18:48:51 -0600 Subject: Use null instead of undefined when no error exists --- packages/subproviders/src/subproviders/redundant_rpc.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/subproviders/src/subproviders/redundant_rpc.ts b/packages/subproviders/src/subproviders/redundant_rpc.ts index 362e7e385..8ae195a87 100644 --- a/packages/subproviders/src/subproviders/redundant_rpc.ts +++ b/packages/subproviders/src/subproviders/redundant_rpc.ts @@ -34,13 +34,13 @@ export class RedundantRPCSubprovider extends Subprovider { }); } public async handleRequest(payload: JSONRPCPayload, next: () => void, - end: (err?: Error, data?: any) => void): Promise { + end: (err: Error|null, data?: any) => void): Promise { const rpcsCopy = this.rpcs.slice(); try { const data = await RedundantRPCSubprovider.firstSuccessAsync(rpcsCopy, payload, next); - end(undefined, data); + end(null, data); } catch (err) { - end(err); + end(new Error('testing')); } } -- cgit v1.2.3