Changed to throw Exception when MessageFactory cannot parse message.

Change-Id: I12210d99cfec08173124b60eb59fb4212d889d53
This commit is contained in:
Michal Lisiecki
2015-07-03 15:55:15 +02:00
parent 8df997f101
commit 9e152cca33
@@ -413,7 +413,10 @@ public class MessageFactory<T extends IsoMessage> {
if (index == null) {
log.error(String.format("ISO8583 MessageFactory has no parsing guide for message type %04x [%s]",
type, new String(buf)));
return null;
throw new ParseException(String.format(
"ISO8583 MessageFactory has no parsing guide for message type %04x [%s]",
type,
new String(buf)), 0);
}
//First we check if the message contains fields not specified in the parsing template
boolean abandon = false;
@@ -424,7 +427,7 @@ public class MessageFactory<T extends IsoMessage> {
}
}
if (abandon) {
return m;
throw new ParseException("ISO8583 MessageFactory cannot parse fields", 0);
}
//Now we parse each field
if (useBinary) {