3#ifndef PDFSDK_CXX_EXCEPTION_H_INCLUDED_
4#define PDFSDK_CXX_EXCEPTION_H_INCLUDED_
10#define PDF_THROW(code, message) throw PDF::Exception((code), (message))
12#define PDF_CHECK(expr, code, message) \
15 PDF_THROW((code), (message)); \
18#define PDF_CHECK_ERROR(pattern, code, message) \
20 const PDErrCode ec_avoid_double_inst = (code); \
21 PDF_CHECK(ec_avoid_double_inst == (pattern), ec_avoid_double_inst, (message)); \
24#define PDF_CHECK_SUCCESS(code, message) PDF_CHECK_ERROR(kPDErrSuccess, (code), (message))
25#define PDF_CHECK_SUCCESS_X(code) PDF_CHECK_ERROR(kPDErrSuccess, (code), PDGetErrMessage())
43 : std::runtime_error(message)
53 : std::runtime_error(message)
The exception class for the PDF SDK.
Definition exception.h:35
PDErrCode GetErrorCode() const noexcept
Gets the error code associated with the exception.
Definition exception.h:62
Exception(PDErrCode code, const std::string &message)
Constructs a new exception with the specified error code and message.
Definition exception.h:42
const char * GetErrorMessage() const noexcept
Gets the error message associated with the exception.
Definition exception.h:69
Exception(PDErrCode code, const char *message)
Constructs a new exception with the specified error code and message.
Definition exception.h:52
int32_t PDErrCode
Definition errors.h:44