Class SwiftException
Exception that is thrown by the SwiftReader in order to indicate SWIFT syntax errors.
public class SwiftException : Exception, ISerializable
- Inheritance
-
SwiftException
- Implements
- Inherited Members
Constructors
SwiftException(SwiftExceptionCode)
Create a new SwiftException.
public SwiftException(SwiftExceptionCode nCode)
Parameters
nCode
SwiftExceptionCode
SwiftException(SwiftExceptionCode, SwiftField)
Create a new SwiftException.
public SwiftException(SwiftExceptionCode nCode, SwiftField aField)
Parameters
nCode
SwiftExceptionCodeaField
SwiftField
SwiftException(SwiftExceptionCode, SwiftField, int, Exception)
Create a new SwiftException.
public SwiftException(SwiftExceptionCode nCode, SwiftField aField, int nLine, Exception aInnerException)
Parameters
nCode
SwiftExceptionCodeaField
SwiftFieldnLine
intaInnerException
Exception
SwiftException(SwiftExceptionCode, int)
Create a new SwiftException.
public SwiftException(SwiftExceptionCode nCode, int nLine)
Parameters
nCode
SwiftExceptionCodenLine
int
SwiftException(SwiftExceptionCode, string)
Create a new SwiftException.
public SwiftException(SwiftExceptionCode nCode, string sMessage)
Parameters
nCode
SwiftExceptionCodesMessage
string
Properties
Code
Provides the detailed exception code of this SwiftException.
public SwiftExceptionCode Code { get; }
Property Value
- SwiftExceptionCode
Refer to the documentation of the SwiftExceptionCode for a list of possible values and their meaning.
Field
SwiftField instance that this exception refers to.
public SwiftField Field { get; }
Property Value
- SwiftField
If this exception was thrown due to a particular malformed SWIFT field, then this property provides a reference to the SwiftField instance that is in error. The exception code will be MalformedFieldContent. For other exceptions the Field property is
null
.
Line
Provides the line number of the line in the SWIFT stream where the error occured.
public int Line { get; }
Property Value
- int
Processing a SWIFT stream begins with the line number one. While the stream is read, the line number is incremented by every CRLF sequence, including '@@' sequences, if those are permitted. As all SWIFT messages should start with a CRLF right away, the very first SWIFT field already begins at line two.
The value zero indicates that the line number is not known. This should never happen, however.