From 85fffccfceaef5652452eb60bef98b0c49a898c6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 26 Oct 2013 23:24:27 +0100 Subject: Better error message. --- src/mono_picture_asset_writer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mono_picture_asset_writer.cc b/src/mono_picture_asset_writer.cc index 1f384c28..ccbc8e87 100644 --- a/src/mono_picture_asset_writer.cc +++ b/src/mono_picture_asset_writer.cc @@ -29,6 +29,7 @@ using std::istream; using std::ostream; using std::string; using boost::shared_ptr; +using boost::lexical_cast; using namespace libdcp; struct MonoPictureAssetWriter::ASDCPState : public ASDCPStateBase @@ -68,8 +69,9 @@ MonoPictureAssetWriter::write (uint8_t* data, int size) uint64_t const before_offset = _state->mxf_writer.Tell (); string hash; - if (ASDCP_FAILURE (_state->mxf_writer.WriteFrame (_state->frame_buffer, _state->encryption_context, 0, &hash))) { - boost::throw_exception (MXFFileError ("error in writing video MXF", _asset->path().string())); + ASDCP::Result_t const r = _state->mxf_writer.WriteFrame (_state->frame_buffer, _state->encryption_context, 0, &hash); + if (ASDCP_FAILURE (r)) { + boost::throw_exception (MXFFileError ("error in writing video MXF (" + lexical_cast (int(r)) + ")", _asset->path().string())); } ++_frames_written; -- cgit v1.2.3