PDFNetException Class |
Namespace: pdftron.Common
public sealed class PDFNetException : IStringable
The PDFNetException type exposes the following members.
Name | Description | |
---|---|---|
PDFNetException |
Creates a new PDFNetException based on an existing Exception.
|
Name | Description | |
---|---|---|
CondExpr |
Gets the conditional expression that triggered the exception to be thrown.
| |
ErrorCode |
Gets the associated error code, if any, with this exception.
| |
FileName |
Gets the filename from where the exception was thrown.
| |
Function |
Gets the name of the function/method where the exception was thrown.
| |
IsPDFNetException |
Gets whether this exception is a PDFNet exception.
| |
LineNumber |
Gets the line number in the file where the exception was thrown.
| |
Message |
Gets the detailed message describing the exception.
|
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
GetCondExpr |
Gets the conditional expression that triggered the exception to be thrown.
| |
GetErrorCode |
Gets the associated error code, if any, with this exception.
| |
GetFileName |
Gets the filename from where the exception was thrown.
| |
GetFunction |
Gets the name of the function/method where the exception was thrown.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetLineNumber |
Gets the line number in the file where the exception was thrown.
| |
GetMessage |
Gets the detailed message describing the exception.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString |
Returns a string representation of this exception.
|
PDFNetException is only a utility class for getting more useful error messages from PDFNet. Because PDFNetException does not inherit from Exception class, it can never be caught. In order to see more detailed error/exception messages, it is recommended to create a new PDFNetException instance from a caught Exception instance's HResult value.
If the caught exception is not associated with any PDFNet specific exceptions, all methods will return default values based on the caught exception (i.e. the exception message). In this case, the original exception can be obtained by calling the GetPlatformException() method.
try { // do something... } catch (Exception e) { // Get the associated PDFNetException from the hresult, if any PDFNetException pdfnetEx = new PDFNetException(e.HResult); // Get useful error message pdfnetEx.ToString(); }