From ddbe59179e64c45a375d6886f892059b49fd81b2 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 17 Dec 2021 15:30:47 -0500 Subject: C API: simplify new error handling and improve documentation --- manual/index.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'manual') diff --git a/manual/index.rst b/manual/index.rst index ba2fe1dc..fcbdea4c 100644 --- a/manual/index.rst +++ b/manual/index.rst @@ -3632,14 +3632,16 @@ For a detailed list of changes, please see the file - C API Enhancements - - Overhaul error handling for the object handle functions - C API. See comments in the "Object handling" section of - :file:`include/qpdf/qpdf-c.h` for details. - In particular, exceptions thrown by the underlying C++ code - when calling object accessors are caught and converted into - errors. The errors can be trapped by registering an error - handler with ``qpdf_register_oh_error_handler`` or will be - written to stderr if no handler is registered. + - Overhaul error handling for the object handle functions C API. + Some rare error conditions that would previously have caused a + crash are now trapped and reported, and the functions that + generate them return fallback values. See comments in the + ``ERROR HANDLING`` section of :file:`include/qpdf/qpdf-c.h` for + details. In particular, exceptions thrown by the underlying C++ + code when calling object accessors are caught and converted into + errors. The errors can be checked by call ``qpdf_has_error``. + Use ``qpdf_silence_errors`` to prevent the error from being + written to stderr. - Add ``qpdf_get_last_string_length`` to the C API to get the length of the last string that was returned. This is needed to -- cgit v1.2.3-54-g00ecf