From 71be53eff696014d61ba2cbe3608ea1820f6ff7e Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Fri, 26 Jan 2018 00:44:21 -0500 Subject: [PATCH] types: don't throw an exception when it's likely we are already reporting an exception Empty files are a thing that can happen. Don't bomb out just reporting one's existence. Signed-off-by: Zygo Blaxell --- src/bees-types.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bees-types.cc b/src/bees-types.cc index 4e47ba0..3b57e87 100644 --- a/src/bees-types.cc +++ b/src/bees-types.cc @@ -160,7 +160,8 @@ BeesFileRange::file_size() const // lost a race (e.g. a file was truncated while we were building a // matching range pair with it). In such cases we should probably stop // whatever we were doing and backtrack to some higher level anyway. - THROW_CHECK1(invalid_argument, m_file_size, m_file_size > 0); + // Well, OK, but we call this function from exception handlers... + THROW_CHECK1(invalid_argument, m_file_size, m_file_size >= 0); // THROW_CHECK2(invalid_argument, m_file_size, m_end, m_end <= m_file_size || m_end == numeric_limits::max()); } return m_file_size;