From b7e82f95a44704372ae13a4c1f677d89aea6c546 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Mon, 4 Mar 2019 14:20:22 -0500 Subject: [PATCH] minor todo --- routes/baseActionsRouter.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/routes/baseActionsRouter.js b/routes/baseActionsRouter.js index 29d81fe..096de88 100644 --- a/routes/baseActionsRouter.js +++ b/routes/baseActionsRouter.js @@ -505,8 +505,7 @@ router.get("/block/:blockHash", function(req, res, next) { res.locals.limit = limit; res.locals.offset = offset; res.locals.paginationBaseUrl = "/block/" + blockHash; - - // TODO handle RPC error + coreApi.getBlockByHashWithTransactions(blockHash, limit, offset).then(function(result) { res.locals.result.getblock = result.getblock; res.locals.result.transactions = result.transactions; @@ -514,6 +513,13 @@ router.get("/block/:blockHash", function(req, res, next) { res.render("block"); + next(); + + }).catch(function(err) { + res.locals.userMessage = "Error getting block data"; + + res.render("block"); + next(); }); });