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(); }); });