From 11cd796652523f4c6a4d23fd121ee0dac34a9f25 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Sat, 27 Feb 2016 01:27:27 +0800 Subject: [PATCH] Show the block address if block_cache::get() failed --- block-cache/block_cache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block-cache/block_cache.cc b/block-cache/block_cache.cc index 6ecce1f..e7e6f14 100644 --- a/block-cache/block_cache.cc +++ b/block-cache/block_cache.cc @@ -620,7 +620,9 @@ block_cache::get(block_address index, unsigned flags, validator::ptr v) return *b; } - throw std::runtime_error("couldn't get block"); + std::ostringstream out; + out << "couldn't get block " << index; + throw std::runtime_error(out.str()); } void