diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-28 20:17:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-03-28 20:35:27 +0100 |
| commit | ad7158be9a8caec264f873ce5e68265dce1489e1 (patch) | |
| tree | 9899df8c4e1d7ba9213df1ad17f5af43d2abe356 /src/tools | |
| parent | 12f3a134e76a666b577cd20a193d3b650e0c5b6a (diff) | |
More logging and catch all exceptions properly.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic_dist_writer.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tools/dcpomatic_dist_writer.cc b/src/tools/dcpomatic_dist_writer.cc index c667f2f95..49e7bfd36 100644 --- a/src/tools/dcpomatic_dist_writer.cc +++ b/src/tools/dcpomatic_dist_writer.cc @@ -70,6 +70,7 @@ using std::cin; using std::min; using std::string; using std::runtime_error; +using std::exception; using boost::optional; #ifdef DCPOMATIC_LINUX @@ -157,10 +158,12 @@ string read (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_remaining, uint64_t total) { ext4_file in; + LOG_DIST("Opening %1 for read", to.generic_string()); int r = ext4_fopen(&in, to.generic_string().c_str(), "rb"); if (r != EOK) { throw VerifyError (String::compose("Failed to open file %1", to.generic_string()), r); } + LOG_DIST("Opened %1 for read", to.generic_string()); uint8_t* buffer = new uint8_t[block_size]; Digester digester; @@ -337,9 +340,14 @@ try nanomsg->send(DIST_WRITER_OK "\n"); } catch (CopyError& e) { + LOG_DIST("CopyError: %1 %2", e.message(), e.number()); nanomsg->send(String::compose(DIST_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number())); } catch (VerifyError& e) { + LOG_DIST("VerifyError: %1 %2", e.message(), e.number()); nanomsg->send(String::compose(DIST_WRITER_ERROR "\n%1\n%2\n", e.message(), e.number())); +} catch (exception& e) { + LOG_DIST("Exception: %1", e.what()); + nanomsg->send(String::compose(DIST_WRITER_ERROR "\n%1\n0\n", e.what())); } #ifdef DCPOMATIC_LINUX |
