From 83591a4390db550a7d1495b9699c62315e2d7710 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 8 Jan 2014 10:05:49 +0000 Subject: Throw better file errors (with numbers). --- src/util.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/util.cc') 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* 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* 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); -- cgit v1.2.3