ASCOM Namespace

ASCOM Exceptions that can be thrown by the ASCOM Library

Classes

ActionNotImplementedException Exception thrown by a driver when it receives an unknown command through the Action method.
DriverAccessCOMException Exception thrown by DriverAccess to return a driver COM error to the client. This exception appears as a COMException to the client having the original exception's description and error number as well as the original exception as the inner exception.
DriverException This is the generic driver exception. Drivers are permitted to directly throw this exception as well as any derived exceptions. Note that the Message property is a member of Exception, the base class of DriverException. The HResult property of Exception is simply renamed to Number.

This exception should only be thrown if there is no other more appropriate exception already defined, e.g. PropertyNotImplemented, InvalidOperationException, InvalidValueException, NotConnectedException etc. These specific exceptions should be thrown where appropriate rather than using the more generic DriverException. Conform will not accept DriverExceptions where more appropriate exceptions are already defined.

As good programming practice, the Message property should not be empty, so that users understand why the exception was thrown.

ErrorCodes Error numbers for use by drivers.
HelperException General exception for use within Tools components.
InvalidOperationException This exception should be raised by the driver to reject a command from the client.
InvalidValueException Exception to report an invalid value supplied to a driver.
MethodNotImplementedException All methods defined by the relevant ASCOM standard interface must exist in each driver. However, those methods do not all have to be implemented. The minimum requirement for each defined method is to throw the ASCOM.MethodNotImplementedException. Note that no default constructor is supplied. Throwing this requires the the method name.
NotConnectedException This exception should be raised when an operation is attempted that requires communication with the device, but the device is disconnected.
NotImplementedException All properties and methods defined by the relevant ASCOM standard interface must exist in each driver. However, those properties and methods do not all have to be implemented. This exception is a base class for PropertyNotImplementedException and MethodNotImplementedException, which drivers should use for throwing the relevant exception(s). This class is intended to be used by clients who wish to catch either of the two specific exceptions in a single catch() clause.
OperationCancelledException This exception should be used to indicate that an in-progress operation has been cancelled.
ParkedException This exception should be used to indicate that movement (or other invalid operation) was attempted while the device was in a parked state.
PropertyNotImplementedException All properties defined by the relevant ASCOM standard interface must exist in each driver. However, those properties do not all have to be implemented. The minimum requirement for each defined property is to throw the ASCOM.PropertyNotImplementedException for each of its accessors. Note that no default constructor is supplied. Throwing this requires both the property name and unimplemented accessor type to be supplied.
SlavedException This exception should be used to indicate that movement (or other invalid operation) was attempted while the device was in slaved mode. This applies primarily to domes drivers.
TransformInvalidOperationException Exception thrown what an invalid operation is attempted on the Transform component
TransformUninitialisedException Exception thrown when an attempt is made to read from the transform component before it has had co-ordinates set once by SetJ2000 or SetJNow.
ValueNotSetException Exception to report that no value has yet been set for this property.