InvalidOperationException Class |
Namespace: ASCOM
The InvalidOperationException type exposes the following members.
Name | Description | |
---|---|---|
![]() | InvalidOperationException |
Default public constructor for NotConnectedException takes no parameters.
|
![]() | InvalidOperationException(Exception) |
Initializes a new instance of the InvalidOperationException class
from another exception.
|
![]() | InvalidOperationException(String) |
Initializes a new instance of the InvalidOperationException class
with a non-default error message.
|
![]() | InvalidOperationException(String, Exception) |
Initializes a new instance of the InvalidOperationException class
based on another exception.
|
Name | Description | |
---|---|---|
![]() | Number |
The COM error code for this exception (hex 80040400 - 800404FF)
(Inherited from DriverException.) |
The exception is intended to be used for "logical" errors e.g. trying to use a command when the current configuration of the device does not allow it rather than for device errors such as a communications error.
Its the error to use when the client attempts something, which at another time would be sensible, but which is not sensible right now. If you expect the condition causing the issue to be short lived, you may choose to stall the request until the condition is cleared rather than throwing this exception. Clearly, that is a judgement that you can only make given a specific scenario.
If you need to throw this error as a COM exception use the error number: 0x8004040B.