SWIFT Integration Projects

Error Message Information

This section explains the SWIFT OTD Library validation error files and messages.

Error Messages

There are separate error messages and reporting mechanisms for each type of validation performed by a Service. You can control the amount of debugging information in the error messages you receive by using the debug flags as parameters when you call the command() method. The library’s error parser provides the following debug levels:

Error message file output appears at the end of any message that generates an error.

Setting the Debug Level

The available debug level flags are:

Using the Debug Level flags, you can configure the debugging information you receive by setting the appropriate debug parameter in the OTD’s command() method. For example, to set the error message level to the Regular Information level (I flag), with abbreviations turned on (A flag), you would set command() with the parameters A and I. You can do this from the Collaboration Editor’s Business Rules Designer as displayed below.

Figure 7 Setting the debug level using the Business Rules Designer

Setting the Debug Level

This produces the following Java code (this example uses the mt_202 Validation Collaboration:


     mt_202_1.command( "AI" );

Calling command() enables any of the debug functions presented as a parameter. For more information, see the SWIFT OTD Library Javadoc.

Message Examples

An example of a regular information-level parse error (cannot find a required field) is:


at 0: com.stc.swift.runtime.SwiftUnmarshalException: mt_103.Mt_103: 0:
 Failed to parse required child(Data).

An example of a parse error with the debug level enabled (cannot find a required field) is:


at 146: null: com.stc.swift.runtime.SwiftUnmarshalException:
 mt_543.Mt_543.Data.GeneralInformation.FunctionOfTheMessage: 146:
 Failed to parse required child(String2).

Given this path to the data, you can determine where in the message the parser failed by looking at:

See MFVR Errors for MFVR-specific error information. For more detailed error information, see Error Message Information.

Parse Debug Level Message Example

The following example shows error message output at the parse debug level:


[main] PARSE - Swift: matchDelimSkip("{1:") --> true.
[main] PARSE - Swift: getData("F|A|L") --> "F".
[main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.AppIdentifier: 3: Mapped data("F").
[main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.AppIdentifier: 3: Mapped rep[0].
[main] PARSE - Swift: getData(charSet, 2, 2) --> "01".
[main] DEBUG - Swift: mt_502.Mt_502.BasicHeader.ServiceIdentifier: 4:
 The following is the last field successfully parsed the 4th 22a:
[main] PARSE - Swift: matchDelimSkip("22H::") --> true.
[main] PARSE - Swift: getData(charSet, 4, 4) --> "PAYM".
[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String3:
 218: Mapped data("PAYM").
[main] PARSE - Swift: matchDelimSkip("//") --> true.
[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String3:
 218: Mapped rep[0].
[main] PARSE - Swift: getData(charSet, 4, 4) --> "APMT".
[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String5:
 224: Mapped data("APMT").
[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH.String5:
 224: Mapped rep[0].
[main] PARSE - Swift: matchDelimSkip("
:") --> true.
[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH: 213:
 Mapped rep[0].

The message goes on for several more lines, not indicating any error. Then the parser is looking for any more 22a’s, F or H, and does not find one. See the following example:


[main] DEBUG - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator[3]: 159: Mapped rep[3].
[main] PARSE - Swift: matchDelimSkip("22F::") --> false.
[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorF: 231:
 Failed to find BeginDelimiter("22F::").
[main] PARSE - Swift: matchDelimSkip("22H::") --> false.
[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.Indicator.IndicatorH: 231:
 Failed to find BeginDelimiter("22H::").

The parser then looks for a 98a either option A|B|C as follows:


[main] PARSE - Swift: matchDelimSkip("98A::") --> false.
[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeA: 231:
 Failed to find BeginDelimiter("98A::").
[main] PARSE - Swift: matchDelimSkip("98B::") --> false.
[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeB: 231:
 Failed to find BeginDelimiter("98B::").
[main] PARSE - Swift: matchDelimSkip("98C::") --> false.
[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails.DateTime[0].DateTimeC: 231:
 Failed to find BeginDelimiter("98C::").

The parser finds no repetitions, which does not fit in the required range of 1 to 3 as described in the following example, so at this point, the parser fails, because no expected repetitions were found:


[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails: 231:
 Failed to match minimum repititions[ 1 < 0 <= 3 ].

[main] PARSE - Swift: mt_502.Mt_502.Data.OrderDetails:
145: Failed to parse
 required child(DateTime).
[main] PARSE - Swift: mt_502.Mt_502.Data:
145: Failed to match minimum
 repititions[ 1 < 0 <= 1 ].
[main] PARSE - Swift: mt_502.Mt_502.Data:
73: Failed to parse required
 child(OrderDetails).
[main] PARSE - Swift: mt_502.Mt_502: 
67: Failed to match minimum repititions[ 1 < 0 <= 1 ].
[main] PARSE - Swift: mt_502.Mt_502: 
0: Failed to parse required child(Data).
 [main] LAST  - Swift: Last match: mt_502.Mt_502.
Exception in thread "main" at 0: null: com.stc.
swift.runtime.SwiftUnmarshalException:
 mt_502.Mt_502: 0: Failed to parse required child(Data).
    at com.stc.swift.runtime.SwiftOtdRep.
throwExcept(SwiftOtdRep.java:1977)
    at com.stc.swift.runtime.SwiftOtdRep.
parseChildren(SwiftOtdRep.java:1577)
    at com.stc.swift.runtime.SwiftOtdRep.
parse(SwiftOtdRep.java:1486)
    at com.stc.swift.runtime.SwiftOtdRep.
unmarshal(SwiftOtdRep.java:1339)