Error Handling

ErrorCode

enum LuxFlux.fluxEngineNET.ErrorCode

fluxEngine Error Code

This enumeration describes the possible error codes that are returned by fluxEngine. Since the .NET API wraps the underlying C API, this list contains the error codes returned by the C API itself.

Any exception thrown by fluxEngine that is a subclass of the Error class will contain one of these codes.

Not all of these codes will be thrown in the form of a Error class, as some of them are mapped onto the standard .NET exception classes.

Values:

Success

Success

This error code will never be returned, but exists in this enumeration for the sake of completeness.

Unknown

Unknown error

If an error occurred that has not yet been categorized with a specific error code, this code will be returned.

AllocationFailure

Allocation failure

This code exists for compatibility with the underlying C API, it will never be returned. (Allocation failures will be reported as OutOfMemoryException.)

InvalidArgument

Invalid argument

If an underlying C API function returns this error code, the error will be thrown as a .NET ArgumentException.

HandleNoLongerValid

Handle no longer valid

If an operation is performed on a handle that has been destroyed, but where the metadata is still kept in memory because one or more models and/or processing contexts have not yet been freed, this error will be returned.

If this error occurs this indicates undefined behavior, as this essentially amounts to a use-after-free of the handle structure.

This error code will always be set in a subclass of Error, ObjectNoLongerValidError, to allow the user to polymorphically catch this kind of error.

See also

ObjectNoLongerValidError

ModelNoLongerValid

The model is no longer valid

If an operation is performed on a model whose handle has already been destroyed, this error will be returned.

In contrast to ErrorCode.HandleNoLongerValid occurring, this is not an indication of undefined behavior.

This error code will always be set in a subclass of Error, ObjectNoLongerValidError, to allow the user to polymorphically catch this kind of error.

See also

ObjectNoLongerValidError

ProcessingContextNoLongerValid

The processing context is no longer valid

If an operation is performed on a model whose handle has already been destroyed, this error will be returned.

It is also possible that this error is returned if the number of processing threads of a given handle was changed after creating the processing context.

In contrast to ErrorCode.HandleNoLongerValid occurring, this is not an indication of undefined behavior.

This error code will always be set in a subclass of Error, ObjectNoLongerValidError, to allow the user to polymorphically catch this kind of error.

See also

ObjectNoLongerValidError

IndexOutOfRange

Index out of range

If an underlying C API function returns this error code, the error will be thrown as a .NET ArgumentOutOfRangeException.

NotImplemented

Not implemented

A specific functionality is not implemented in fluxEngine’s public API (yet).

If an underlying C API function returns this error code, the error will be thrown as a .NET System.NotImplementedException.

InvalidWrapper

Invalid wrapper

The user is attempting to access an object that was already disposed.

If an underlying C API function returns this error code, the error will be thrown as a .NET System.ObjectDisposedException.

FileAccessError

File access error

If an underlying C API function returns this error code, the error will be thrown as a .NET System.IO.IOException.

FileNotFoundError

File not found error

If an underlying C API function returns this error code, the error will be thrown as a .NET System.IO.FileNotFoundException.

FileAccessDeniedError

File access denied error

If an underlying C API function returns this error code, the error will be thrown as a .NET System.IO.IOException.

FileTypeError

File type error

If an underlying C API function returns this error code, the error will be thrown as a .NET System.IO.IOException.

FileInUseError

File in use error

If an underlying C API function returns this error code, the error will be thrown as a .NET System.IO.IOException.

ReadOnlyFilesystem

Read-only filesystem error

If an underlying C API function returns this error code, the error will be thrown as a .NET System.IO.IOException.

IOError

Generic I/O error

If an underlying C API function returns this error code, the error will be thrown as a .NET System.IO.IOException.

HandleAlreadyCreated

A handle has already been created

Current limitations of the fluxEngine library allow only for the creation of a single handle. If the user attempts to create a second handle, this error code will be returned.

InvalidLicense

Invalid license

The supplied license is invalid, and could either not be parsed, or the parsed data did not make any sense. This is typically the case if something other than the correct license file is passed to the constructor of fluxEngineNET.Handle.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

LicenseWrongProduct

License is for wrong product

The supplied license is for the wrong product (for example, fluxTrainer), but not for fluxEngine.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

LicenseExpired

License has expired

If the license was issued only up to a certain date, and that date has passed, the license is expired and this error will be returned.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

LicenseUpdateExpired

License is for previous versions of the software

The supplied license is only valid for versions of fluxEngine that were built before a specific date, and the current version of fluxEngine has passed that date.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

LicenseIdentifierMismatch

License identifier mismatch

The supplied license does not match the current system. For example, when a license issued to the mainboard serial number of a given system is run on a system with a different mainboard serial number, this error will be returned.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

LicenseDongleRemoved

The license dongle has been removed

The license was tied to a dongle and that dongle has since been removed from the computer.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

LicenseDeviceNotConnected

The device the license is tied to is not connected

If the license is tied to the serial number of a device (such as a camera), it must be connected before certain operations can occur, such as the creation of a processing context or the processing of data. If the device is not currently connected this error will be returned. (Note that only the current connection state is checked.)

If the license is not tied to the serial number of a camera this type of error will not occur.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

LicenseFeatureNotPresent

A license feature required for this operation is not present in the license

For example, if model processing is not enabled, attempting to load a model will fail with this error.

When creating a device processing context, if a specific device is of a type that is not supported by the license, this may also be returned.

This error code will always be set in a subclass of Error, LicenseError, to allow the user to polymorphically catch this kind of error.

See also

LicenseError

ThreadCreationError

Unable to create a background processing thread

A background processing thread could not be created by fluxEngine, possibly due to resource exhaustion or an operating system limit.

This error code will always be set in a subclass of Error, InitializationError, to allow the user to polymorphically catch this kind of error.

See also

InitializationError

ThreadInitFunctionError

The user-supplied thread initialization function returned a non-zero return code

This error code exists for completeness sake, as the .NET wrapper code will propagate exceptions from the thread initialization function directly to the user.

InvalidModelData

Invalid Model Data

When loading a model (either from memory or from a file) this error code is returned if the model could not be loaded, for example because the data of the model was corrupt, or the file that was passed was not a LuxFlux Runtime Model (.fluxmdl).

This could also be the result of an I/O error that could not be properly caught.

This error code will always be set in a subclass of Error, ModelLoadError, to allow the user to polymorphically catch this kind of error.

ModelContainsUnsupportedFilter

Model Contains Unsupported Filter

The supplied model contains a filter that is not supported by the current version of fluxEngine. It was likely created with a newer version of fluxTrainer.

This error code will always be set in a subclass of Error, ModelLoadError, to allow the user to polymorphically catch this kind of error.

ModelContainsUnlicensedFilter

Model Contains Unlicensed Filter

The supplied model contains a filter that is not allowed by the currently loaded license, and can hence not be loaded.

This error code will always be set in a subclass of Error, ModelLoadError, to allow the user to polymorphically catch this kind of error.

ModelNotConsistent

The supplied model is not consistent

The model that was loaded is not in a consistent state. This indicates a problem during the export of the model.

This error code will always be set in a subclass of Error, ModelLoadError, to allow the user to polymorphically catch this kind of error.

ModelSourceTypeUnsupported

The supplied model is for unsupported data

The model that was loaded is for processing data of a type that is currently not supported by fluxEngine. Currently only hyperspectral data (Cubes or PushBroom frames) are supported.

This error code will always be set in a subclass of Error, ModelLoadError, to allow the user to polymorphically catch this kind of error.

ModelWrongSourceType

The loaded model is not a HSI model

When creating a processing context for HSI data, if the loaded model is not a HSI model, this error code will be returned.

At the moment, this will never happen, as only HSI models can be loaded. Future versions might return this error code though.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

FilterCreationError

Could not create required filter

When creating a processing context, several filters are automatically created and added to the model to ensure that they can properly transform the input data to the format the model expects. This error is returned if one of these filters could not be created for any reason.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

WavelengthRangeDeterminationError

Could not determine wavelength range of model

The wavelength setting of the source node in a given model could not be read during the creation of a processing context.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

InputDimensionError

The supplied dimensions of the input do not make sense

The dimensions of the input supplied while either creating a processing context or providing the next input data pointer do not make sense, for example because a negative number was provided.

This error code will always be set in a subclass of Error, InputDimensionError, to allow the user to polymorphically catch this kind of error.

InputStrideError

The supplied stride of the input does not fit

The stride of the input supplied while providing the next input data pointer does not fit the dimension structure of the input data.

For example, if an entire cube is being processed, and the dimension structure of the cube is {500, 300, 200}, then a stride structure of {60000, 200, 1} would be acceptable, but a stride structure of {50000, 200, 1} would not be, as the first stride is smaller than the second stride times the second dimension.

This error code will always be set in a subclass of Error, InputStrideError, to allow the user to polymorphically catch this kind of error.

WhiteReferenceMissingError

No white reference provided

When creating a processing context for a model that is given in reflectances or absorbances, but the data provided by the user will be in raw intensities, a white reference must exist for fluxEngine to be able to automatically reference the input data. If no white reference is provided during processing context creation in that circumstance, this error will be returned.

Note: this error will not occur if the data provided by the user is already reflectance data — or the model is set to process raw intensities and the user provides intensity data.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

WhiteReferenceDimensionError

The provided dimensions of the white reference are not acceptable

When providing a white reference while setting up a processing context, the dimension of the provided reference must be supplied. If those dimensions are not congruent to the input dimensions, this error code will be returned.

Please note that references always have an additional dimension that allows fluxEngine to average over multiple reference measurements, so the reference for processing entire HSI cubes will be a tensor of order 4, for example.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

DarkReferenceDimensionError

The provided dimensions of the dark reference are not acceptable

When providing a dark reference while setting up a processing context, the dimension of the provided reference must be supplied. If those dimensions are not congruent to the input dimensions, this error code will be returned.

Please note that references always have an additional dimension that allows fluxEngine to average over multiple reference measurements, so the reference for processing entire HSI cubes will be a tensor of order 4, for example.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

PreprocessingSetupError

An error occurred while setting up preprocessing

While performing the final actions required to initialize the preprocessing steps for the input data, an error occurred.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

ProcessingSetupError

An error occurred while setting up processing

While performing the final actions required to initialize the processing sequence, an error occurred.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

InputWavelengthValueError

Input wavelength value error

One of the wavelengths supplied as the input data did not have a finite value. This happens if the list of input wavelengths contain NaN or infinities.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

InputScalarTypeError

The supplied scalar type of the input does not match

The scalar type of the input supplied while providing the next input data pointer does not match the scalar type with which the context was created.

This error code will always be set in a subclass of Error, InputScalarTypeError, to allow the user to polymorphically catch this kind of error.

IlluminationReferenceMissingError

No illumination reference provided

When creating a processing context for a model that requires illumination corrected intensities, but the data provided by the user has not yet been illumination corrected, an illumination reference must exist for fluxEngine to be able to automatically reference the input data. If no illumination reference is provided during processing context creation in that circumstance, this error will be returned.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

IlluminationReferenceDimensionError

The provided dimensions of the illumination reference are not acceptable

When providing an illumination reference while setting up a processing context, the dimension of the provided reference must be supplied. If those dimensions are not congruent to the input dimensions, this error code will be returned.

Please note that references always have an additional dimension that allows fluxEngine to average over multiple reference measurements, so the reference for processing entire HSI cubes will be a tensor of order 4, for example.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

ValueTypeMismatchError

Input value type mismatch error

This error occurs when a model for intensity data (raw intensities, radiances, etc.) is used in conjunction with data that has already been white referenced (e.g. reflectances). In that case it is not possible to create a processing context and this error will occur.

This can also occur if a source explicitly requires relative or absolute radiances, but the input data is only provided in raw intensities.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

OutputIdNotPresent

No output sink with the given output id is present

This error will be returned by ProcessingContext.FindOutputSink() if there is no output sink in the loaded model with the requested output id.

This error code will always be set in a subclass of Error, OutputIntrospectionError, to allow the user to polymorphically catch this kind of error.

OutputIdNotUnique

Multiple outuput sinks with the given output id are present

This error will be returned by ProcessingContext.FindOutputSink() if there is more than one output sink in the loaded model with the requested output id.

This error code will always be set in a subclass of Error, OutputIntrospectionError, to allow the user to polymorphically catch this kind of error.

StorageTypeMismatch

Storage type mismatch while introspecting an output sink

When using either ProcessingContext.OutputSinkTensorStructure() or ProcessingContext.OutputSinkObjectListStructure() to obtain more detailed information about an output sink, if the output sink has a different storage type, this error will be returned.

For example, calling ProcessingContext.OutputSinkTensorStructure() for an output sink that will return a list of detected objects would result in this error.

This error code will always be set in a subclass of Error, OutputIntrospectionError, to allow the user to polymorphically catch this kind of error.

ProcessingContextTypeMismatch

The processing context is of the wrong type

When setting the next input pointer by calling ProcessingContext.SetSourceData() in the wrong variant, because the context was created for a different type of data, this error will be returned.

For example, calling ProcessingContext.SetSourceData() in the HSI cube variant on a context that was created to process PushBroom frames will result in this error.

This error code will always be set in a subclass of Error, ProcessingContextTypeMismatchError, to allow the user to polymorphically catch this kind of error.

ProcessingUnknownError

An unknown error occurred during processing

This happens when the actual processing step during a call to ProcessingContext.ProcessNext() fails in an unknown manner.

This error code will always be set in a subclass of Error, ProcessingError, to allow the user to polymorphically catch this kind of error.

ProcessingInternalError

An internal error occurred during processing

This error code will always be set in a subclass of Error, ProcessingError, to allow the user to polymorphically catch this kind of error.

ProcessingAborted

Processing was aborted by the user

This error code will always be set in a subclass of Error, ProcessingError, to allow the user to polymorphically catch this kind of error.

ProcessingSourceDataMissing

The source data for processing was not set by the user

If the user has never called ProcessingContext.SetSourceData() before a call to ProcessingContext.ProcessNext() this error will occur.

This also occurs if the user has not set the source data again after a call to ProcessingContext.ResetState().

This error code will always be set in a subclass of Error, ProcessingError, to allow the user to polymorphically catch this kind of error.

ParameterInfoNoLongerValid

The parameter info is no longer valid

If a given parameter info was obtained from a connected device the parameter information will only remain valid as long as the device is connected. If the device has since disconnected the parameter information will become invalid.

If that is the case this error will be returned by methods that return information about a parameter info.

In contrast to ErrorCode.HandleNoLongerValid occurring, this is not an indication of undefined behavior.

This error code will always be set in a subclass of Error, ObjectNoLongerValidError, to allow the user to polymorphically catch this kind of error.

ParameterIndexOutOfRange

The parameter index is out of range

If information about a parameter is queried by index and the given parameter index is out of range, this error will occur.

Note that a negativ index will result in a ErrorCode.InvalidArgument instead of this error, as a negative index is never valid.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterNameDoesNotExist

A parameter with that name does not exist

If information about a parameter is queried by name and that name does not describe a valid parameter, this error will occur.

An alias for this code exists under the name ErrorCode.DeviceParameterNotFound.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterInternalQueryError

An internal error occurred while querying a parameter

This indicates an internal error (and likely a bug) when querying information about a parameter.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterWrongType

When querying a parameter the wrong type was encountered

When querying information about a parameter that requires the parameter to be of a specific type, and the parameter in question is of a different type, this error occurs.

An alias for this code exists under the name ErrorCode.DeviceParameterTypeError.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterEnumerationIndexOutOfRange

The enumeration entry index is out of range

If information about an enumeration entry is queried by index and the given enumeration entry index is out of range, this error will occur.

Note that a negative index will result in a ErrorCode.InvalidArgument instead of this error, as a negativ index is never valid.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterEnumerationNameDoesNotExist

An enumeration entry with that name does not exist

If information about an enumeration entry is queried by name and that name does not describe a valid enumeration entry, this error will occur.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterAffectedIndexOutOfRange

The affected parameter index is out of range

If information about an affected parameter is queried by index and the given affected parameter index is out of range, this error will occur.

Note that a negative index will result in a ErrorCode.InvalidArgument instead of this error, as a negativ index is never valid.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterNoDefaults

No defaults are available for the given parameter info

Parameter infos of connected devices do not contain information about default values. When querying default values of these parameter infos this error will occur.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

ParameterQueryError

Error querying parameter information

An error occurred while querying parameter information. For example, when attempting to query the minimum value of a parameter that is currently not accessible, this error might occur.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

DeviceEnumerationInvalidIndex

An invalid index was supplied while querying an enumeration result

While retrieving an enumeration result object (driver, device, warning, error) by its index, an invalid index was supplied by the user.

For example, if there were 2 devices found, but the user wants to query the device with index 15, this erorr will occur.

This error code will always be set in a subclass of Error, DeviceEnumerationError, to allow the user to polymorphically catch this kind of error.

DriverNotFound

The specified driver could not be found

When attempting to connect to a device group the specified driver (identified by driver type and name) could not be found.

This error code will always be set in a subclass of Error, DeviceConnectionError, to allow the user to polymorphically catch this kind of error.

DeviceConnectionEnumerationTimeout

Device connection: enumeration timeout

When connecting to a device the device is searched for internally before connecting to it. If the device cannot be found again (assuming the device id stems from a previous enumeration attempt) this error will occur.

Typically this happens when the device disappears between initial enumeration and the connection attempt. This could be due to a loose connection, sudden power loss, or the device crashing after the initial enumeration attempt.

This error code will always be set in a subclass of Error, DeviceConnectionError, to allow the user to polymorphically catch this kind of error.

DeviceConnectionDriverError

Device connection: driver error

During device connection a driver error occurred, most likely indicating that the driver itself crashed for some reason.

This error code will always be set in a subclass of Error, DeviceConnectionError, to allow the user to polymorphically catch this kind of error.

DeviceConnectionParametrizationError

Device connection: internal parametrization error

The driver returned invalid connection parameter information during the connection attempt. This is likely a bug in the driver or fluxEngine.

This error code will always be set in a subclass of Error, DeviceConnectionError, to allow the user to polymorphically catch this kind of error.

DeviceConnectionFailed

Device connection: connection failed

Could not connect to the specified device. The error message will be the message generated by the driver and give a better indication about the actual issue when not being able to connect to the device.

The most common possible causes are:

  • For devices that must be probed: the device is not connected

  • The user doesn’t have permissions to access the device

  • For network devices: the device is in the wrong subnet and is hence not accessible

  • For network devices: the system firewall blocks fluxDriverIsolation.exe from receiving packets from the network

  • The device is not supported by the driver (and that could only be determined during a connection attempt)

  • An invalid connection setting (such as an invalid calibration file) was specified during the connection attempt

This error code will always be set in a subclass of Error, DeviceConnectionError, to allow the user to polymorphically catch this kind of error.

DeviceNoLongerValid

The device is no longer valid

This error occurs when the user attempts to access a device when the corresponding fluxEngine handle has been closed and the device has been force-disconnected and is no longer in a valid state. The user must unload the device group when this error occurs.

In contrast to ErrorCode.HandleNoLongerValid occurring, this is not an indication of undefined behavior.

This error code will always be set in a subclass of Error, ObjectNoLongerValidError, to allow the user to polymorphically catch this kind of error.

DeviceParameterListNotFound

Parameter list not found

The specified parameter list has not been exposed by the connected driver.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

DeviceParameterNotFound

Parameter not found (alias)

A parameter with the specific name does not exist.

This error may also occur during device connection and when writing unrelated parameters, as some parameters are re-read after connection and after each parameter change to keep meta data for the device up to date. If one of these internal parameters (that the driver uses to give fluxEngine additional information) is somehow missing, this error could occur in those cases (i.e. writing to a different parameter or connecting the device group).

This name is an alias for ErrorCode.ParameterNameDoesNotExist, as they have the same code.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

DeviceParameterAccessError

Parameter access error

The parameter in question could not be accessed

This occurs when a parameter is not accessible (in the case of read or write operation) or read-only (in the case of a write operation).

For example, some camera devices have the ability to set a frame rate independent of the exposure time — and a boolean parameter must be enabled for this before the actual frame rate parameter may be written to (or even read from).

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

DeviceParameterTypeError

Parameter type error (alias)

The parameter in question has the wrong type. For example, attempting to read an integer value from a string parameter will result in this error.

This error may also occur during device connection and when writing unrelated parameters, as some parameters are re-read after connection and after each parameter change to keep meta data for the device up to date. If one of these internal parameters (that the driver uses to give fluxEngine additional information) has the wrong type (due to a bug in the driver), this error could occur in those cases (i.e. writing to a different parameter or connecting the device group).

This name is an alias for ErrorCode.ParameterWrongType, as they have the same code.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

DeviceParameterReadError

Parameter read error

The parameter in question could not be read, even though the access mode is OK.

This can have multiple reasons, for example if the device has been unplugged in the mean time.

This error may also occur during device connection and when writing unrelated parameters, as some parameters are re-read after connection and after each parameter change to keep meta data for the device up to date. If one of these internal parameters (that the driver uses to give fluxEngine additional information) cannot be read, this error could occur in those cases (i.e. writing to a different parameter or connecting the device group).

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

DeviceParameterWriteError

Parameter write error

The parameter in question could not be written to.

This may occur if an invalid value is given to a parameter. For example, if an integer parameter only accepts values between 2 and 5, and the value 17 is supplied, this error may occur.

This error code will always be set in a subclass of Error, ParameterError, to allow the user to polymorphically catch this kind of error.

DeviceTypeError

Device type error

When attempting to use a type-specific device function (such as functions for instrument devices or light control devices), if the type of the device does not match the function that is being called, this error will occur.

This error code will always be set in a subclass of Error, DeviceError, to allow the user to polymorphically catch this kind of error.

DeviceStatusQueryError

Device status query error

Typically it should always be possible to query the status of a connected device, even if the device is in an irrecoverable error state. But if that does fail for some unknown reason this error will occur.

This error code will always be set in a subclass of Error, DeviceError, to allow the user to polymorphically catch this kind of error.

DeviceResetError

Device recoverable error reset failed

While attempting to reset from a recoverable error the reset failed. This can typically occur in three situations:

  • The recoverable error has not yet been cleared — for example a temperature sensor might still indicate that a temperature is too far out of bounds for the device to function at all.

  • The original recoverable error has cleared, but in the mean time a different recoverable error has occurred.

  • The device has encountered an irrecoverable error in the mean time.

This error code will always be set in a subclass of Error, DeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceIncompatibleError

The instrument device is not compatible with fluxEngine

The instrument device is currently not compatible with the public fluxEngine API. This may occur if a newer driver is used in conjunction with an older version of fluxEngine.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceShmAlreadySetup

The shared memory buffers have already been set up

InstrumentDevice.SetupInternalBuffers() may only be called once for an instrument device; any call to that method afterwards will trigger this error.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceShmSetupError

Error setting up shared memory buffers

InstrumentDevice.SetupInternalBuffers() could not set up the shared memory segment for receiving buffers from the instrument device.

If not enough memory is available for the amount (and size) of the buffers this could occur on a normal system, but otherwise is an indication of a more serious problem.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceShmNotSetupError

Shared memory has not yet been set up

This occurs when attempting to start acquisition while the shared memory has not yet been set up.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceInvalidReferenceName

The specified reference name is invalid

While starting acquisition, if the specified reference name is not supported by the device, this error will occur. (See the documentation of the InstrumentDevice.AcquisitionParameters structure for further details.)

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceAcquisitionStartError

Acquisition start error

Device acquisition could not be started. This typically indicates a misconfiguration of the device, or a bug in the driver.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceAcquisitionStopError

Acquisition stop error

Device acquisition could not be stopped. This typically indicates a bug in the driver or fluxEngine, as stopping acquisition should always work.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

InstrumentDeviceInternalBufferError

Internal buffer error

This is an indication of a bug in the driver or fluxEngine because the driver returned a buffer that fluxEngine doesn’t know about.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

BufferAlreadyReturned

Buffer already returned

Cannot perform an operation on a buffer that has been returned back to the driver.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

BufferContainerFull

Buffer container full

Cannot add a buffer to a container because the container is full.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

BufferStructureMismatch

Buffer structure mismatch

When copying data into a persistent buffer, or copying data out of a buffer, there is a mismatch between the structure of the buffer and the source or target of the copy operation.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

BufferTargetMemoryTooSmallError

Buffer target memory too small

When extracting raw data from a buffer container this indicates the memory area the user has provided is too small.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

BufferContainerPastRingBufferSize

Buffer container: the entry is no longer available

When extracting data from a buffer container: the buffer container in question is a ring buffer, and the specific entry is not available anymore due to the ring buffer’s capacity.

This error code will always be set in a subclass of Error, InstrumentDeviceError, to allow the user to polymorphically catch this kind of error.

LightControlDeviceForceStateError

Cannot force state of light control device

This is coupled with a driver-generated error message that explains the reason for the failure.

This error code will always be set in a subclass of Error, LightControlDeviceError, to allow the user to polymorphically catch this kind of error.

LightControlDeviceRampError

Cannot wait for the ramp of the light control device

This is coupled with a driver-generated error message that explains the reason for the failure.

This error code will always be set in a subclass of Error, LightControlDeviceError, to allow the user to polymorphically catch this kind of error.

DeviceProcessingInvalidReferenceError

Device processing setup: invalid reference

The user has specified a reference during the processing setup that the driver does not support in the current mode. For example, a device that provides pre-referenced data (for example a virtual camera) will not support white or dark references when setting up a processing context.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

DeviceProcessingInformationMissing

Device processing setup: internal inforamtion missing

The driver has not provided the appropriate amount of information for fluxEngine to be able to set up a processing context for the device. This is likely a bug in the driver.

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

DeviceProcessingPreprocessingSetupError

Device processing setup: preprocessing setup error

Could not set up the preprocessing steps for a processing context. The following lists the situations that could lead to this error (though the list is not exhaustive):

  • A missing white reference in some cases

  • The user wants to record HSI data interpolated onto a wavelength grid that has no overlap with the actual wavelengths of the device

  • The user’s license for fluxEngine does not support the specific preprocessing steps required

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

DeviceProcessingReferenceSetupError

Reference setup error

An error occurred while setting up the supplied reference measurements that didn’t fall into one of the existing categories, such as:

  • ErrorCode.DeviceProcessingInvalidReferenceError

  • ErrorCode.WhiteReferenceDimensionError

  • ErrorCode.DarkReferenceDimensionError

  • ErrorCode.IlluminationReferenceDimensionError

This error code will always be set in a subclass of Error, ProcessingContextCreationError, to allow the user to polymorphically catch this kind of error.

DeviceProcessingBufferIncompatible

The suppled processing buffer is incompatible

When using a device buffer or persistent buffer as the input to a processing context (via ther overload of ProcessingContext.SetSourceData() that accepts a Buffer or a PersistentBuffer), if the structure of the buffer is not compatible with the processing context, this error will occur.

For example, if the user creates a processing context for a camera device, changes the ROI of the camera, and then uses buffers obtained after the ROI change with the processing context before the ROI change, this error may occur.

This error code will always be set in a subclass of Error, InputBufferIncompatibleError, to allow the user to polymorphically catch this kind of error.

MeasurementProcessingTypeError

The measurement type is incompatible with the model

When creating a processing context for a specific measurement, if the type of the measurement is incompatible with the given model, this error will occur.

MeasurementProcessingMutuallyIncompatible

Multiple measurements are mutually incompatible

When creating a processing context for a list of measurements, and the measurements in the list are mutually incompatible (for example due to a different scalar type, but could also be if they have different white/dark references), this error will occur.

MeasurementProcessingIncompatibleWithFixedSize

Cannot create a processing context for fixed sizes

When creating a processing context for a list of measurements, and the measurements in the list are compatible, but have varying spatial sizes, and the user has not specified the MeasurementProcessingContextFlag_VariableSpatialSize flag, this error will occur.

Error

class LuxFlux.fluxEngineNET.Error : Exception

Base exception class for fluxEngine errors

When fluxEngine throws an exception, it will always throw one of the following exceptions:

  • This class or a subclass of it to describe an error that is

  • OutOfMemoryException to describe allocation failures

  • ArgumentException if an invalid argument was passed to any fluxEngine method

  • ArgumentOutOfRangeException to indicate an index was out of range (for example, when introspecting groups of a model, if the group id is invalid, this will be thrown)

  • During thread creation any exception in the thread initialization callback the user supplies will be forwarded to the user

Subclassed by LuxFlux.fluxEngineNET.DeviceError, LuxFlux.fluxEngineNET.InitializationError, LuxFlux.fluxEngineNET.InputBufferIncompatibleError, LuxFlux.fluxEngineNET.InputDimensionError, LuxFlux.fluxEngineNET.InputScalarTypeError, LuxFlux.fluxEngineNET.InputStrideError, LuxFlux.fluxEngineNET.LicenseError, LuxFlux.fluxEngineNET.ModelLoadError, LuxFlux.fluxEngineNET.ObjectNoLongerValidError, LuxFlux.fluxEngineNET.OutputIntrospectionError, LuxFlux.fluxEngineNET.ParameterError, LuxFlux.fluxEngineNET.ProcessingContextCreationError, LuxFlux.fluxEngineNET.ProcessingContextTypeMismatchError, LuxFlux.fluxEngineNET.ProcessingError

Public Functions

Error (string message, ErrorCode code, int osErrorCode = 0)

Constructor

The error message may be retrieved by the Message property of the Exception base class, the code parameter will be accessible via the Code class member, the osErrorCode parameter via the OSErrorCode class member.

Param message:

The error message

Param code:

The fluxEngine error code

Param osErrorCode:

The underlying operating system error code

Public Members

ErrorCode Code = 0

The error code associated with this exception

int OSErrorCode = 0

The operating system error code associated with this exception, if any

This will contain the operating system error code associated with this exception. Some errors may not involve calls to the operating system, in which case this will be 0.

Public Static Functions

void ThrowFromArguments (string message, ErrorCode errorCode, int osErrorCode)

Throw an error from a set of arguments

This will automatically throw the correct subclass of the error class depending on the specified error code. The arguments will be passed to the constructor of that class.

Param message:

The error message

Param errorCode:

The error code

Param osErrorCode:

The underlying operating system error code if an OS function was responsible for the specific error

ObjectNoLongerValidError

class LuxFlux.fluxEngineNET.ObjectNoLongerValidError : LuxFlux.fluxEngineNET.Error

Object no longer valid error

The object in question is no longer valid. For example because it has already been disposed.

LicenseError

class LuxFlux.fluxEngineNET.LicenseError : LuxFlux.fluxEngineNET.Error

License Error

This error class exists to allow the user to polymorphically catch all exceptions that relate to the license being rejected by fluxEngine. This includes the following error codes:

  • ErrorCode.InvalidLicense

  • ErrorCode.LicenseWrongProduct

  • ErrorCode.LicenseExpired

  • ErrorCode.LicenseUpdateExpired

  • ErrorCode.LicenseIdentifierMismatch

  • ErrorCode.LicenseDongleRemoved

InitializationError

class LuxFlux.fluxEngineNET.InitializationError : LuxFlux.fluxEngineNET.Error

Initialization Error

This error class exists to allow the user to polymorphically catch all exceptions that relate to initialization issues in fluxEngine. This includes the following error codes:

  • ErrorCode.ThreadCreationError

  • ErrorCode.ThreadInitFunctionError

ModelLoadError

class LuxFlux.fluxEngineNET.ModelLoadError : LuxFlux.fluxEngineNET.Error

Model Load Error

This error class exists to allow the user to polymorphically catch all exceptions that relate to loading and parsing models in fluxEngine. This includes the following error codes:

  • ErrorCode.InvalidModelData

  • ErrorCode.ModelContainsUnsupportedFilter

  • ErrorCode.ModelContainsUnlicensedFilter

  • ErrorCode.ModelNotConsistent

  • ErrorCode.ModelSourceTypeUnsupported

ProcessingContextCreationError

class LuxFlux.fluxEngineNET.ProcessingContextCreationError : LuxFlux.fluxEngineNET.Error

Processing Context Creation Error

This error class exists to allow the user to polymorphically catch most exceptions that relate to the creation of processing contexts in fluxEngine. This includes the following error codes:

  • ErrorCode.ModelWrongSourceType

  • ErrorCode.FilterCreationError

  • ErrorCode.WavelengthRangeDeterminationError

  • ErrorCode.WhiteReferenceMissingError

  • ErrorCode.WhiteReferenceDimensionError

  • ErrorCode.DarkReferenceDimensionError

  • ErrorCode.IlluminationReferenceMissingError

  • ErrorCode.IlluminationReferenceDimensionError

  • ErrorCode.PreprocessingSetupError

  • ErrorCode.ProcessingSetupError

  • ErrorCode.InputWavelengthValueError

  • ErrorCode.DeviceProcessingInvalidReferenceError

  • ErrorCode.DeviceProcessingInformationMissing

  • ErrorCode.DeviceProcessingPreprocessingSetupError

  • ErrorCode.DeviceProcessingReferenceSetupError

  • ErrorCode.MeasurementProcessingMutuallyIncompatible

  • ErrorCode.MeasurementProcessingIncompatibleWithFixedSize

InputDimensionError

class LuxFlux.fluxEngineNET.InputDimensionError : LuxFlux.fluxEngineNET.Error

Input Dimension Error

This error class exists to allow the user to polymorphically catch all exceptions that relate to the input dimensions not being specified correctly, either while creating a processing context, or while setting the source data before execution. This always corresponds to the error code ErrorCode.InputDimensionError.

InputStrideError

class LuxFlux.fluxEngineNET.InputStrideError : LuxFlux.fluxEngineNET.Error

Input Stride Error

This error class exists to allow the user to polymorphically catch all exceptions that relate to the input strides not being specified correctly while setting the source data before execution. This always corresponds to the error code ErrorCode.InputStrideError.

InputBufferIncompatibleError

class LuxFlux.fluxEngineNET.InputBufferIncompatibleError : LuxFlux.fluxEngineNET.Error

Input Buffer Incompatible Error

This error class exists to allow the user to polymorphically catch all exceptions that relate to the input buffer not being compatible with the processing context while setting the source data before execution. This always corresponds to the error code ErrorCode.DeviceProcessingBufferIncompatible.

OutputIntrospectionError

class LuxFlux.fluxEngineNET.OutputIntrospectionError : LuxFlux.fluxEngineNET.Error

Output Introspection Error

This error class exists to allow the user to polymorphically catch most exceptions that relate to the introspection of output sinks in a given processing context. This includes the following error codes:

  • ErrorCode.OutputIdNotPresent

  • ErrorCode.OutputIdNotUnique

  • ErrorCode.StorageTypeMismatch

ProcessingContextTypeMismatchError

class LuxFlux.fluxEngineNET.ProcessingContextTypeMismatchError : LuxFlux.fluxEngineNET.Error

Processing Context Type Error

This error class exists to allow the user to polymorphically catch if they accidentally try to set the wrong type of input data for a given processing context, or attempt to create a processing context for measurements that are of the wrong type for a specific model. This includes the following error codes:

  • ErrorCode.ProcessingContextTypeMismatch

  • ErrorCode.MeasurementProcessingTypeError

ProcessingError

class LuxFlux.fluxEngineNET.ProcessingError : LuxFlux.fluxEngineNET.Error

Processing Error

This error class exists to allow the user to polymorphically catch most exceptions that relate to the actual processing of data. This includes the following error codes:

  • ErrorCode.ProcessingUnknownError

  • ErrorCode.ProcessingInternalError

  • ErrorCode.ProcessingAborted

  • ErrorCode.ProcessingSourceDataMissing

ParameterError

class LuxFlux.fluxEngineNET.ParameterError : LuxFlux.fluxEngineNET.Error

ParameterError

This error class exists to allow the user to polymorphically catch most exceptions that relate to parametrization of devices. This includes the following error codes:

  • ErrorCode.ParameterIndexOutOfRange

  • ErrorCode.ParameterNameDoesNotExist

  • ErrorCode.ParameterInternalQueryError

  • ErrorCode.ParameterWrongType

  • ErrorCode.ParameterEnumerationIndexOutOfRange

  • ErrorCode.ParameterEnumerationNameDoesNotExist

  • ErrorCode.ParameterAffectedIndexOutOfRange

  • ErrorCode.ParameterNoDefaults

  • ErrorCode.ParameterQueryError

  • ErrorCode.DeviceParameterListNotFound

  • ErrorCode.DeviceParameterNotFound

  • ErrorCode.DeviceParameterTypeError

  • ErrorCode.DeviceParameterAccessError

  • ErrorCode.DeviceParameterTypeError

  • ErrorCode.DeviceParameterReadError

  • ErrorCode.DeviceParameterWriteError

DeviceError

class LuxFlux.fluxEngineNET.DeviceError : LuxFlux.fluxEngineNET.Error

DeviceError

This error class exists to allow the user to polymorphically catch most exceptions that relate to devices themselves. This includes the following error codes:

  • ErrorCode.DeviceTypeError

  • ErrorCode.DeviceStatusQueryError

  • ErrorCode.DeviceResetError

Additionally there are the following subclasses:

  • DeviceEnumerationError - for errors related to device enumeration

  • DeviceConnectionError - for errors related to device connection

  • InstrumentDeviceError - for errors related to instrument devices

  • LightControlDeviceError - for errors related to light control devices

Subclassed by LuxFlux.fluxEngineNET.DeviceConnectionError, LuxFlux.fluxEngineNET.DeviceEnumerationError, LuxFlux.fluxEngineNET.InstrumentDeviceError, LuxFlux.fluxEngineNET.LightControlDeviceError

DeviceEnumerationError

class LuxFlux.fluxEngineNET.DeviceEnumerationError : LuxFlux.fluxEngineNET.DeviceError

Device Enumeration Error

This error class exists to allow the user to polymorphically catch most exceptions that relate to the enumeration of devices. This includes the following error codes:

  • ErrorCode.DeviceEnumerationInvalidIndex

DeviceConnectionError

class LuxFlux.fluxEngineNET.DeviceConnectionError : LuxFlux.fluxEngineNET.DeviceError

Device Connection Error

This error class exists to allow the user to polymorphically catch most exceptions that relate to the connection of device groups. This includes the following error codes:

  • ErrorCode.DriverNotFound

  • ErrorCode.DeviceConnectionEnumerationTimeout

  • ErrorCode.DeviceConnectionDriverError

  • ErrorCode.DeviceConnectionParametrizationError

  • ErrorCode.DeviceConnectionFailed

InstrumentDeviceError

class LuxFlux.fluxEngineNET.InstrumentDeviceError : LuxFlux.fluxEngineNET.DeviceError

Instrument Device Error

This error class exists to allow the user to polymorphically catch most exceptions that relate to operations specific to instrument devices. This includes the following error codes:

  • ErrorCode.InstrumentDeviceIncompatibleError

  • ErrorCode.InstrumentDeviceShmAlreadySetup

  • ErrorCode.InstrumentDeviceShmSetupError

  • ErrorCode.InstrumentDeviceShmNotSetupError

  • ErrorCode.InstrumentDeviceInvalidReferenceName

  • ErrorCode.InstrumentDeviceAcquisitionStartError

  • ErrorCode.InstrumentDeviceAcquisitionStopError

  • ErrorCode.InstrumentDeviceInternalBufferError

  • ErrorCode.BufferAlreadyReturned

  • ErrorCode.BufferContainerFull

  • ErrorCode.BufferStructureMismatch

  • ErrorCode.BufferTargetMemoryTooSmallError

LightControlDeviceError

class LuxFlux.fluxEngineNET.LightControlDeviceError : LuxFlux.fluxEngineNET.DeviceError

Light Control Device Error

This error class exists to allow the user to polymorphically catch most exceptions that relate to operations specific to light control devices. This includes the following error codes:

  • ErrorCode.LightControlDeviceForceStateError

  • ErrorCode.LightControlDeviceRampError