From f3d7c26de1f575a14017a161ad1fdd2b93385e03 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 26 Sep 2009 18:36:04 +0000 Subject: removed qexc; non-compatible ABI change git-svn-id: svn+q:///qpdf/trunk@709 71b93d88-0707-0410-a8cf-f5a4172ac649 --- libqpdf/QPDF.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'libqpdf/QPDF.cc') diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index ba71e629..d49ad5f1 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -1,4 +1,3 @@ - #include #include @@ -197,7 +196,8 @@ QPDF::BufferInputSource::seek(off_t offset, int whence) break; default: - throw QEXC::Internal("invalid argument to BufferInputSource::seek"); + throw std::logic_error( + "INTERNAL ERROR: invalid argument to BufferInputSource::seek"); break; } } @@ -392,7 +392,7 @@ QPDF::parse() void QPDF::warn(QPDFExc const& e) { - this->warnings.push_back(e.unparse()); + this->warnings.push_back(e.what()); if (! this->suppress_warnings) { std::cerr << "WARNING: " << this->warnings.back() << std::endl; @@ -956,8 +956,8 @@ QPDF::showXRefTable() break; default: - throw QEXC::Internal("unknown cross-reference table type while" - " showing xref_table"); + throw std::logic_error("unknown cross-reference table type while" + " showing xref_table"); break; } std::cout << std::endl; @@ -988,7 +988,8 @@ QPDF::readObjectInternal(InputSource* input, // Although dictionaries and arrays arbitrarily nest, these // variables indicate what is at the top of the stack right // now, so they can, by definition, never both be true. - throw QEXC::Internal("readObjectInternal: in_dict && in_array"); + throw std::logic_error( + "INTERNAL ERROR: readObjectInternal: in_dict && in_array"); } QPDFObjectHandle object; @@ -1121,9 +1122,10 @@ QPDF::readObjectInternal(InputSource* input, } else if (! object.isInitialized()) { - throw QEXC::Internal(std::string("uninitialized object (token = ") + - QUtil::int_to_string(token.getType()) + - ", " + token.getValue() + ")"); + throw std::logic_error( + "INTERNAL ERROR: uninitialized object (token = " + + QUtil::int_to_string(token.getType()) + + ", " + token.getValue() + ")"); } else { @@ -1846,13 +1848,13 @@ QPDF::pipeStreamData(int objid, int generation, pipeline->write((unsigned char*)buf, len); } } - catch (QEXC::General& e) + catch (std::runtime_error& e) { QTC::TC("qpdf", "QPDF decoding error warning"); warn(QPDFExc(this->file.getName(), this->file.getLastOffset(), "error decoding stream data for object " + QUtil::int_to_string(objid) + " " + - QUtil::int_to_string(generation) + ": " + e.unparse())); + QUtil::int_to_string(generation) + ": " + e.what())); } pipeline->finish(); } -- cgit v1.2.3-54-g00ecf