From f00985fefb3984330a5a1e42782f708369407257 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 5 Jun 2019 12:04:05 -0700 Subject: [PATCH] node: consistent rpc error messages --- lib/node/rpc.js | 6 +++--- lib/wallet/rpc.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node/rpc.js b/lib/node/rpc.js index 90082f11..a46b2025 100644 --- a/lib/node/rpc.js +++ b/lib/node/rpc.js @@ -613,7 +613,7 @@ class RPC extends RPCBase { const entry = await this.chain.getEntry(hash); if (!entry) - throw new RPCError(errs.MISC_ERROR, 'Block not found'); + throw new RPCError(errs.MISC_ERROR, 'Block not found.'); const block = await this.chain.getBlock(entry.hash); @@ -652,7 +652,7 @@ class RPC extends RPCBase { const entry = await this.chain.getEntry(height); if (!entry) - throw new RPCError(errs.MISC_ERROR, 'Block not found'); + throw new RPCError(errs.MISC_ERROR, 'Block not found.'); const block = await this.chain.getBlock(entry.hash); @@ -706,7 +706,7 @@ class RPC extends RPCBase { const entry = await this.chain.getEntry(hash); if (!entry) - throw new RPCError(errs.MISC_ERROR, 'Block not found'); + throw new RPCError(errs.MISC_ERROR, 'Block not found.'); if (!verbose) return entry.toRaw().toString('hex', 0, 80); diff --git a/lib/wallet/rpc.js b/lib/wallet/rpc.js index 1dd9ccec..a0b8fda7 100644 --- a/lib/wallet/rpc.js +++ b/lib/wallet/rpc.js @@ -1080,7 +1080,7 @@ class RPC extends RPCBase { if (entry) height = entry.height; else - throw new RPCError(errs.MISC_ERROR, 'Block not found'); + throw new RPCError(errs.MISC_ERROR, 'Block not found.'); } if (height === -1)