From 16ef78ade0faf1cbdbdb2dc6c4430fb4996c0323 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 25 Jul 2018 17:46:15 +0200 Subject: Clarify error message when file cannot be created, The default error is "Not a valid SNDFILE* pointer." which is rather obscure to end-users. --- libs/audiographer/audiographer/sndfile/sndfile_writer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/audiographer/audiographer/sndfile/sndfile_writer.h b/libs/audiographer/audiographer/sndfile/sndfile_writer.h index d0049360d2..b106eba6a8 100644 --- a/libs/audiographer/audiographer/sndfile/sndfile_writer.h +++ b/libs/audiographer/audiographer/sndfile/sndfile_writer.h @@ -84,6 +84,10 @@ class SndfileWriter virtual void init() { + if (SF_ERR_NO_ERROR != SndfileHandle::error ()) { + throw Exception (*this, boost::str (boost::format + ("Could create output file (%1%)") % path)); + } samples_written = 0; add_supported_flag (ProcessContext::EndOfInput); } -- cgit v1.2.3