FAST Exceptions
All exceptions thrown by FAST coders are inherited from the FastException class and gathered into the following subclasses:
- StaticErrorException: these errors occur during FAST template parsing;
- DynamicErrorException: these errors occur during encoding of FIX messages or decoding of FAST data chunks.
Each exception object has the Code property that provides the error code.
Exact lists of possible errors codes can be found in the StaticErrorException.ErrorCode and DynamicErrorException.ErrorCode class definitions.
Error Codes
Error codes are composed per the following rules:
- A symbolic code consists of a symbolic prefix and a unique numeric value. The symbolic codes are
D
for dynamic errors (DynamicErrorException) andS
for static errors (StaticErrorException). - The unique numeric value is four digits where the first digit is
1
for static errors and2
for dynamic errors, and the following three digits specify the unique number within the given class of errors.
For instance, the error code of D2201
means that it is a dynamic error (it begins with the D2
sequence) with a numeric code of 2201
.
In other words, error codes always start with S1
or D2
, followed by three digits.
The FastErrorCode has the following two properties:
- SymbolicCode: returns the symbolic code;
- NumericCode: returns the numeric part of the symbolic code (as an unsigned integer).
For example:
try
{
// A FAST operation
}
catch (FastException e)
{
if (e.Code.NumericCode == 2101)
{
Console.WriteLine($"Error {e.Code.SymbolicCode}: the FIX engine is not initialized.");
}
}
Static Errors
Static errors occur during the parsing of FAST templates and implemented by and can be fixed only by updating the FAST template.
The corresponding exceptions are inherited from the StaticErrorException class.
Dynamic Errors
Dynamic errors occur during encoding or decoding data.
Dynamic errors during encoding mean that the FIX message being encoded has a wrong field value. Such errors can be fixed by changing the FIX message content.
Dynamic errors during data decoding mean that the input data can not be decoded correctly either due to the FAST template mismatch or due to data corruption. To fix such errors, it is needed to use the proper FAST template or fix the data.
Please see the DynamicErrorException.ErrorCode class for details.
Correspondence With Standard FAST Errors
The FAST 1.1 Specification provides several definitions for FAST errors. The following table presents the correspondence between standard FAST errors and OnixS FAST implementation error codes.
FAST Specification Code | OnixS Code | Remarks |
---|---|---|
S1 |
S1001 | |
S2 |
S1002 | |
S3 |
Unused | |
S4 |
S1004 | |
S5 |
S1005 | |
D1 |
Unused | |
D2 |
D2205 | |
D3 |
Unused | |
D4 |
D2209 | |
D5 |
D2207 | |
D6 |
D2206 | |
D7 |
D2210 | |
D8 |
Unused | |
D9 |
Unused | |
D10 |
Unused | |
D11 |
Unused | |
D12 |
Unused |
Reportable errors (R1
-R9
) defined in the FAST specification has no direct equivalents in the current implementation.