summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-07-14 20:24:30 +0200
committerCarl Hetherington <cth@carlh.net>2022-07-14 20:24:30 +0200
commit8dfe86431424fa6c43a0ff3ca092989d21a47dbf (patch)
tree585c9cb53c4a3afa495286dd3d9e6be742cfc685
parentf4a41311291cb7b171a025dd9e572e66b10388be (diff)
More error message improvements.
-rw-r--r--src/lib/reel_writer.cc8
-rw-r--r--src/lib/util.cc6
-rw-r--r--src/lib/util.h1
3 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index f6a42c6f0..f02091449 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -391,7 +391,7 @@ ReelWriter::finish (boost::filesystem::path output_dcp)
boost::filesystem::create_hard_link (video_from, video_to, ec);
if (ec) {
- LOG_WARNING_NC ("Hard-link failed; copying instead");
+ LOG_WARNING("Hard-link failed (%1); copying instead", error_details(ec));
auto job = _job.lock ();
if (job) {
job->sub (_("Copying video file into DCP"));
@@ -404,7 +404,7 @@ ReelWriter::finish (boost::filesystem::path output_dcp)
} else {
boost::filesystem::copy_file (video_from, video_to, ec);
if (ec) {
- LOG_ERROR ("Failed to copy video file from %1 to %2 (%3)", video_from.string(), video_to.string(), ec.message());
+ LOG_ERROR("Failed to copy video file from %1 to %2 (%3)", video_from.string(), video_to.string(), error_details(ec));
throw FileError (ec.message(), video_from);
}
}
@@ -423,7 +423,7 @@ ReelWriter::finish (boost::filesystem::path output_dcp)
boost::filesystem::rename (film()->file(aaf), audio_to, ec);
if (ec) {
throw FileError (
- String::compose (_("could not move audio asset into the DCP (%1:%2)"), ec.category().name(), ec.value()), aaf
+ String::compose(_("could not move audio asset into the DCP (%1)"), error_details(ec)), aaf
);
}
@@ -440,7 +440,7 @@ ReelWriter::finish (boost::filesystem::path output_dcp)
boost::filesystem::rename (film()->file(aaf), atmos_to, ec);
if (ec) {
throw FileError (
- String::compose (_("could not move atmos asset into the DCP (%1:%2)"), ec.category().name(), ec.value()), aaf
+ String::compose(_("could not move atmos asset into the DCP (%1)"), error_details(ec), aaf
);
}
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 2a21477fd..dd9bbb7eb 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -1181,3 +1181,9 @@ capture_asdcp_logs ()
Kumu::SetDefaultLogSink(&log_sink);
}
+
+string
+error_details(boost::system::error_code ec)
+{
+ return String::compose("%1:%2:%3", ec.category().name(), ec.value(), ec.message());
+}
diff --git a/src/lib/util.h b/src/lib/util.h
index fba5b6828..c62b98df6 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -126,6 +126,7 @@ extern boost::filesystem::path default_font_file ();
extern std::string to_upper (std::string s);
extern void start_of_thread (std::string name);
extern void capture_asdcp_logs ();
+extern std::string error_details(boost::system::error_code ec);
template <class T>
std::list<T>