[block cache] improve exception message
This commit is contained in:
parent
07f44e9c77
commit
e5f969817e
@ -525,8 +525,11 @@ block_cache::get(block_address index, unsigned flags, validator::ptr v)
|
||||
block *b = lookup_or_read_block(index, flags, v);
|
||||
|
||||
if (b) {
|
||||
if (b->ref_count_ && flags & (GF_DIRTY | GF_ZERO))
|
||||
throw std::runtime_error("attempt to write lock block concurrently");
|
||||
if (b->ref_count_ && (flags & (GF_DIRTY | GF_ZERO))) {
|
||||
std::ostringstream out;
|
||||
out << "attempt to write lock block " << index << " concurrently";
|
||||
throw std::runtime_error(out.str());
|
||||
}
|
||||
|
||||
// FIXME: this gets called even for new blocks
|
||||
hit(*b);
|
||||
|
Loading…
Reference in New Issue
Block a user