From 720ce9e8f333ba3911fa8003f08fd8813c19181a Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 29 Nov 2021 07:31:05 -0500 Subject: Improve testing and error handling around operating before processing --- libqpdf/QPDF.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libqpdf/QPDF.cc') diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 4c9296ea..c81aede0 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -85,8 +85,10 @@ class InvalidInputSource: public InputSource private: void throwException() { - throw std::runtime_error( - "QPDF operation attempted after closing input source"); + throw std::logic_error( + "QPDF operation attempted on a QPDF object with no input source." + " QPDF operations are invalid before processFile (or another" + " process method) or after closeInputSource"); } }; -- cgit v1.2.3-54-g00ecf