diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-09-28 23:52:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-09-28 23:52:33 +0100 |
| commit | 0e0c323833972ea1896c05f50e407b566ca12ead (patch) | |
| tree | 8fb7ec41a2f6f76f0528b60e5e4228c70ef7ad03 /src/lib | |
| parent | 447b69c23dcf8f316f0d389e1cf2b78ec764fb82 (diff) | |
Better error when copying the video file into the DCP fails.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/writer.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc index dd2e98eee..5af1aea1e 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -45,6 +45,7 @@ #define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); #define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); #define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_WARNING); +#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); /* OS X strikes again */ #undef set_key @@ -412,9 +413,12 @@ Writer::finish () boost::system::error_code ec; boost::filesystem::create_hard_link (video_from, video_to, ec); if (ec) { - /* hard link failed; copy instead */ - boost::filesystem::copy_file (video_from, video_to); - LOG_WARNING_NC ("Hard-link failed; fell back to copying"); + LOG_WARNING_NC ("Hard-link failed; copying instead"); + 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 ()); + throw FileError (ec.message(), video_from); + } } /* And update the asset */ |
