Haru Free PDF Library
Error handling

Macros

#define HPDF_FAILD_TO_ALLOC_MEM   0x1015
 Memory allocation failed. More...
 
#define HPDF_FILE_IO_ERROR   0x1016
 An error occurred while processing file I/O. More...
 
#define HPDF_INVALID_DOCUMENT   0x1025
 Document object handle is not valid. More...
 

Functions

HPDF_STATUS HPDF_GetError (HPDF_Doc pdf)
 Return the last error code of specified document object. More...
 
void HPDF_ResetError (HPDF_Doc pdf)
 Cleanup document error. More...
 
HPDF_STATUS HPDF_CheckError (HPDF_Error error)
 Check error code. More...
 

Detailed Description

Routines for error processing.

Macro Definition Documentation

◆ HPDF_FAILD_TO_ALLOC_MEM

#define HPDF_FAILD_TO_ALLOC_MEM   0x1015

Memory allocation failed.

Todo:
Deprecate and rename constant

◆ HPDF_FILE_IO_ERROR

#define HPDF_FILE_IO_ERROR   0x1016

An error occurred while processing file I/O.

◆ HPDF_INVALID_DOCUMENT

#define HPDF_INVALID_DOCUMENT   0x1025

Document object handle is not valid.

Function Documentation

◆ HPDF_CheckError()

HPDF_STATUS HPDF_CheckError ( HPDF_Error  error)

Check error code.

Function returns error code if it is not equal to HPDF_OK. If error code is not equal to HPDF_OK and error handler is set, then error handler is called.

Parameters
errorError to be checked
Returns
Error code from error parameter.

◆ HPDF_GetError()

HPDF_STATUS HPDF_GetError ( HPDF_Doc  pdf)

Return the last error code of specified document object.

Parameters
pdfDocument object handle.
Returns
Last error code of document object, or HPDF_OK if no last error.

◆ HPDF_ResetError()

void HPDF_ResetError ( HPDF_Doc  pdf)

Cleanup document error.

Once an error code is set, IO processing functions cannot be invoked. In case of executing a function after the cause of the error is fixed, an application has to invoke HPDF_ResetError() to clear error-code before executing functions.

Parameters
pdfDocument object handle.