diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-08 10:05:49 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-08 10:05:49 +0000 |
| commit | 83591a4390db550a7d1495b9699c62315e2d7710 (patch) | |
| tree | 29c93f38853ae2d99c7bca8c7b52d2c294881c0e /src/util.cc | |
| parent | 3a148fab61d2b23379589a4f0f256c21950742b8 (diff) | |
Throw better file errors (with numbers).
Diffstat (limited to 'src/util.cc')
| -rw-r--r-- | src/util.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util.cc b/src/util.cc index cb58694a..a668b7fc 100644 --- a/src/util.cc +++ b/src/util.cc @@ -82,8 +82,9 @@ string libdcp::make_digest (string filename, boost::function<void (float)>* progress) { Kumu::FileReader reader; - if (ASDCP_FAILURE (reader.OpenRead (filename.c_str ()))) { - boost::throw_exception (FileError ("could not open file to compute digest", filename)); + Kumu::Result_t r = reader.OpenRead (filename.c_str ()); + if (ASDCP_FAILURE (r)) { + boost::throw_exception (FileError ("could not open file to compute digest", filename, r)); } SHA_CTX sha; @@ -101,7 +102,7 @@ libdcp::make_digest (string filename, boost::function<void (float)>* progress) if (r == Kumu::RESULT_ENDOFFILE) { break; } else if (ASDCP_FAILURE (r)) { - boost::throw_exception (FileError ("could not read file to compute digest", filename)); + boost::throw_exception (FileError ("could not read file to compute digest", filename, r)); } SHA1_Update (&sha, read_buffer.Data(), read); |
