LinePrinterException.ErrorCode Property

Returns error code describing condition that triggered the exception.

Syntax

[Visual Basic]
Public ReadOnly Property ErrorCode As Integer
[C#]
public int ErrorCode {get;}

Values

PRINTER_ERROR
In the case of a PRINTER_ERROR, the PortName value includes the ErrorCode:

PortName Error Description
NPCP ErrorCode contains an NPCP error code. Check NPCP documentation to determine meaning.
IRDA ERROR_NOIRDADEVICE: No IRDA device in range.
COR_E_IO: Check InnerException for System.IO.IOException
Serial ErrorCode contains the GetLastError of the Win32 function that returned an error.

CONFIG_ERROR
Configuration errors are thrown when the LinePrinter can not find the information needed to configure itself:

ErrorCode Error Description
ERROR_INVALIDXML XML Printer configuration file is flawed or missing.
ERROR_REGISTERDEVICE LinePrinter could not register a driver needed for the selected PrinterPort.
ERROR_NOT_SUPPORTED Configuration File is specifying that an unsupported port has been selected.

SYSTEM_ERROR
An unexpected System.Exception was thrown. The System.Exception will be passed in InnerException.

More Information

LinePrinterException Class