aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-12-06 08:48:51 +0800
committerFabio Berger <me@fabioberger.com>2017-12-06 08:48:51 +0800
commitc93bb4ef9829f9c8467dea198a4520224cb687f5 (patch)
tree7ecb3e95c732b9495745bb0801c7dd6ff4305981
parente3763bade2a475e2e365b002ee7d664b1e3a107b (diff)
downloaddexon-0x-contracts-c93bb4ef9829f9c8467dea198a4520224cb687f5.tar
dexon-0x-contracts-c93bb4ef9829f9c8467dea198a4520224cb687f5.tar.gz
dexon-0x-contracts-c93bb4ef9829f9c8467dea198a4520224cb687f5.tar.bz2
dexon-0x-contracts-c93bb4ef9829f9c8467dea198a4520224cb687f5.tar.lz
dexon-0x-contracts-c93bb4ef9829f9c8467dea198a4520224cb687f5.tar.xz
dexon-0x-contracts-c93bb4ef9829f9c8467dea198a4520224cb687f5.tar.zst
dexon-0x-contracts-c93bb4ef9829f9c8467dea198a4520224cb687f5.zip
Use null instead of undefined when no error exists
-rw-r--r--packages/subproviders/src/subproviders/redundant_rpc.ts6
1 files changed, 3 insertions, 3 deletions
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<void> {
+ end: (err: Error|null, data?: any) => void): Promise<void> {
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'));
}
}