Skip to content

Commit

Permalink
Add more details in ReadLog exception message
Browse files Browse the repository at this point in the history
Signed-off-by: Wenbo Li <lwb21@mails.tsinghua.edu.cn>
  • Loading branch information
hnjylwb committed Mar 21, 2024
1 parent 113f862 commit 01d91d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/storage/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ void Disk::ReadLog(uint32_t offset, uint32_t count, char *data) {
log_fs_.seekg(offset);
log_fs_.read(data, count);
if (log_fs_.gcount() != count) {
throw DbException("read log failed");
throw DbException("read log failed (offset: " + std::to_string(offset) + ", count: " + std::to_string(count) +
", read: " + std::to_string(log_fs_.gcount()) + ")");
}
}

Expand Down

0 comments on commit 01d91d6

Please sign in to comment.