diff options
author | Jay Berkenbilt <ejb@ql.org> | 2018-02-16 23:25:27 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2018-02-19 03:06:27 +0100 |
commit | d0e99f195a987c483bbb6c5449cf39bee34e08a1 (patch) | |
tree | cead8acd60cd14fd5d904ed380c750540cb361f3 /libqpdf/QPDFExc.cc | |
parent | c2e16827b69f3d3ac3721cfcd608b87f28e2a13f (diff) | |
download | qpdf-d0e99f195a987c483bbb6c5449cf39bee34e08a1.tar.zst |
More robust handling of type errors
Give objects descriptions and context so it is possible to issue
warnings instead of fatal errors for attempts to access objects of the
wrong type.
Diffstat (limited to 'libqpdf/QPDFExc.cc')
-rw-r--r-- | libqpdf/QPDFExc.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libqpdf/QPDFExc.cc b/libqpdf/QPDFExc.cc index 728d4ce8..b816e913 100644 --- a/libqpdf/QPDFExc.cc +++ b/libqpdf/QPDFExc.cc @@ -32,7 +32,10 @@ QPDFExc::createWhat(std::string const& filename, } if (! (object.empty() && offset == 0)) { - result += " ("; + if (! filename.empty()) + { + result += " ("; + } if (! object.empty()) { result += object; @@ -45,7 +48,10 @@ QPDFExc::createWhat(std::string const& filename, { result += "offset " + QUtil::int_to_string(offset); } - result += ")"; + if (! filename.empty()) + { + result += ")"; + } } if (! result.empty()) { |