diff options
author | Jay Berkenbilt <ejb@ql.org> | 2009-10-20 01:09:19 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2009-10-20 01:09:19 +0200 |
commit | 3f8c4c273649c857f5a607dcbb422729fce3a166 (patch) | |
tree | 9a71fbfc838cf876f7982f7213ad994c92c0a3fc /libqpdf/QPDF_optimization.cc | |
parent | b67a3c15e768ed88ea3cdf7525c1ddc649aec2fe (diff) | |
download | qpdf-3f8c4c273649c857f5a607dcbb422729fce3a166.tar.zst |
categorize all error messages and include object information if available
git-svn-id: svn+q:///qpdf/trunk@829 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'libqpdf/QPDF_optimization.cc')
-rw-r--r-- | libqpdf/QPDF_optimization.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libqpdf/QPDF_optimization.cc b/libqpdf/QPDF_optimization.cc index f3833efd..e8d20fd5 100644 --- a/libqpdf/QPDF_optimization.cc +++ b/libqpdf/QPDF_optimization.cc @@ -233,9 +233,12 @@ QPDF::optimizePagesTree( { if (! allow_changes) { - throw QPDFExc(this->file.getName() + - ": optimize detected an " - "inheritable resource"); + throw QPDFExc(qpdf_e_internal, this->file.getName(), + this->last_object_description, + this->file.getLastOffset(), + "optimize detected an " + "inheritable resource when called " + "in no-change mode"); } // This is an inheritable resource @@ -338,7 +341,10 @@ QPDF::optimizePagesTree( } else { - throw QPDFExc(this->file.getName() + ": invalid Type in page tree"); + throw QPDFExc(qpdf_e_damaged_pdf, this->file.getName(), + this->last_object_description, + this->file.getLastOffset(), + "invalid Type in page tree"); } } |