Exceptions
When an error occurs, File Content Extraction can throw an exception. Some of these may be exceptions that are defined by the .NET standard library.
The Filter .NET API defines additional exceptions for problems that can occur specifically with File Content Extraction. These are described in the table below, and are an instance of KeyViewException
, or are derived from KeyViewException
, which is itself derived from System.Exception
. These exceptions have an ErrorCode
property - an int
that corresponds to an error code defined in the C API.
Your application code can handle these exceptions - for example, if you are processing a file and File Content Extraction throws a FormatNotSupportedException
you might skip the file or to add it to a list of files that could not be processed.
Exception class | Description | ErrorCode |
---|---|---|
KeyViewException
|
An exception related to File Content Extraction functionality. | Any defined in the C API |
AutoDetFailException
|
An error occurred when attempting to detect the format of the input document. | 10 |
AutoDetNoFormatException
|
File Content Extraction did not recognize the format of the input document. | 11 |
BadInputStreamException
|
Invalid or corrupt input stream. | 4 |
ChildTimeOutException
|
The requested operation took too long. | 19 |
FormatNotSupportedException
|
The requested operation is not supported for this file format. | 7 |
InputFileNotFoundException
|
File Content Extraction could not find the input file. | 24 |
OpenOutputFileFailedException
|
File Content Extraction could not open the output file. | 25 |
PasswordProtectedException
|
To open this file, you must provide a password. | 8 |
Finally, File Content Extraction can throw a ResourceClosedException
, which indicates that a required resource has been closed. For example, you cannot call methods on a Document
object after you dispose of your Session
.