2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-28 16:00:53 +00:00

Code tidy re-throwing of exceptions

Avoid copying exceptions.
This commit is contained in:
m-holger 2023-03-19 16:57:27 +00:00
parent 1e53da74bc
commit 9c7aa2cbbd
3 changed files with 7 additions and 7 deletions

View File

@ -899,7 +899,7 @@ NNTreeImpl::find(QPDFObjectHandle key, bool return_prev_if_not_found)
repair(); repair();
return findInternal(key, return_prev_if_not_found); return findInternal(key, return_prev_if_not_found);
} else { } else {
throw e; throw;
} }
} }
} }

View File

@ -500,7 +500,7 @@ QPDF::parse(char const* password)
reconstruct_xref(e); reconstruct_xref(e);
QTC::TC("qpdf", "QPDF reconstructed xref table"); QTC::TC("qpdf", "QPDF reconstructed xref table");
} else { } else {
throw e; throw;
} }
} }
@ -1483,7 +1483,7 @@ QPDF::readObject(
warn(e); warn(e);
length = recoverStreamLength(input, og, stream_offset); length = recoverStreamLength(input, og, stream_offset);
} else { } else {
throw e; throw;
} }
} }
object = newIndirect( object = newIndirect(
@ -1684,7 +1684,7 @@ QPDF::readObjectAtOffset(
return QPDFObjectHandle::newNull(); return QPDFObjectHandle::newNull();
} }
} else { } else {
throw e; throw;
} }
} }

View File

@ -469,7 +469,7 @@ QPDFJob::createQPDF()
return nullptr; return nullptr;
} }
} }
throw e; throw;
} }
QPDF& pdf = *pdf_sp; QPDF& pdf = *pdf_sp;
if (pdf.isEncrypted()) { if (pdf.isEncrypted()) {
@ -1968,11 +1968,11 @@ QPDFJob::doProcess(
try { try {
doProcessOnce(pdf, fn, *iter, empty, used_for_input, main_input); doProcessOnce(pdf, fn, *iter, empty, used_for_input, main_input);
return; return;
} catch (QPDFExc& e) { } catch (QPDFExc&) {
auto next = iter; auto next = iter;
++next; ++next;
if (next == passwords.end()) { if (next == passwords.end()) {
throw e; throw;
} }
} }
if (!warned) { if (!warned) {