aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@vespa.ai>2024-02-22 13:57:25 +0000
committerTor Brede Vekterli <vekterli@vespa.ai>2024-02-22 13:57:25 +0000
commit0de157ce036446810178ebe24c6d0528f88a5ec3 (patch)
tree852b641822d9f297f4e8ef6fea4402bab197e6f8 /documentapi
parentcfad2fdd2293397d32386291fcbe0dd96c0520e8 (diff)
Include file names in IO failure exceptions
Diffstat (limited to 'documentapi')
-rw-r--r--documentapi/src/tests/messages/message_fixture.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/documentapi/src/tests/messages/message_fixture.cpp b/documentapi/src/tests/messages/message_fixture.cpp
index e134f62cfba..24c825b41e1 100644
--- a/documentapi/src/tests/messages/message_fixture.cpp
+++ b/documentapi/src/tests/messages/message_fixture.cpp
@@ -130,7 +130,7 @@ MessageFixture::write_file(const std::filesystem::path& filename, const mbus::Bl
return false;
}
if (write(file, blob.data(), blob.size()) != (ssize_t)blob.size()) {
- throw vespalib::Exception("write failed");
+ throw vespalib::Exception(fmt("Write of file '%s' failed", filename.c_str()));
}
close(file);
return true;
@@ -145,7 +145,7 @@ MessageFixture::read_file(const std::filesystem::path& filename)
if (file != -1) {
lseek(file, 0, SEEK_SET);
if (read(file, blob.data(), len) != len) {
- throw vespalib::Exception("read failed");
+ throw vespalib::Exception(fmt("Read of file '%s' failed", filename.c_str()));
}
close(file);
}