|
PoDoFo 1.1.0
|
The error handling class of the PoDoFo library. More...
#include <PdfError.h>
Inherits std::exception.
Public Member Functions | |
| PdfError (PdfErrorCode code, std::string filepath, unsigned line, std::string information={ }) | |
| Create a PdfError object with a given error code. | |
| PdfError (const PdfError &rhs)=default | |
| Copy constructor. | |
| PdfError & | operator= (const PdfError &rhs)=default |
| Assignment operator. | |
| bool | operator== (PdfErrorCode code) |
| Compares this PdfError object with an error code. | |
| bool | operator!= (PdfErrorCode code) |
| Compares this PdfError object with an error code. | |
| std::string_view | GetName () const |
| PdfErrorCode | GetCode () const |
| Return the error code of this object. | |
| const PdErrorInfoStack & | GetCallStack () const |
| Get access to the internal callstack of this error. | |
| void | PrintErrorMsg () const |
| Print an error message to stderr. | |
| const char * | what () const noexcept override |
| Obtain error description. | |
Static Public Member Functions | |
| static std::string_view | ErrorName (PdfErrorCode code) |
| Get the name for a certain error code. | |
| static std::string_view | ErrorMessage (PdfErrorCode code) |
| Get the error message for a certain error code. | |
The error handling class of the PoDoFo library.
If a method encounters an error, a PdfError object is thrown as a C++ exception.
This class does not inherit from std::exception.
This class also provides meaningful error descriptions for the error codes which are values of the enum PdfErrorCode, which are all codes PoDoFo uses (except the first and last one).
| PdfError::PdfError | ( | PdfErrorCode | code, |
| std::string | filepath, | ||
| unsigned | line, | ||
| std::string | information = { } |
||
| ) |
Create a PdfError object with a given error code.
| code | the error code of this object |
| filepath | the file in which the error has occurred. Use the compiler macro FILE to initialize the field. |
| line | the line in which the error has occurred. Use the compiler macro LINE to initialize the field. |
| information | additional information on this error |
Copy constructor.
| rhs | copy the contents of rhs into this object |
|
static |
Get the error message for a certain error code.
|
static |
Get the name for a certain error code.
|
inline |
Get access to the internal callstack of this error.
|
inline |
Return the error code of this object.
| bool PdfError::operator!= | ( | PdfErrorCode | code | ) |
Compares this PdfError object with an error code.
| code | an error code (value of the enum PdfErrorCode) |
| bool PdfError::operator== | ( | PdfErrorCode | code | ) |
Compares this PdfError object with an error code.
| code | an error code (value of the enum PdfErrorCode) |
| void PdfError::PrintErrorMsg | ( | ) | const |
Print an error message to stderr.
This includes callstack and extra info, if any of either was set.
Obtain error description.