hapifhir / hapi-hl7v2

282 stars 137 forks source link

ApplicationRouterImpl will catch all Exceptions including IllegalArgumentException #116

Open davidweisgerber opened 9 months ago

davidweisgerber commented 9 months ago

We have a problem that a customer sends us some invalid HL7 message that contains a line break inside an ORC segment. When receiving this message by TCP/IP, the constructor of ca.uhn.hl7v2.parser.NonStandardStructureDefinition will throw an IllegalArgumentException that is not handled in ApplicationRouterImpl and the exception is only handled at the Runner level. This means that the sender of the message will never receive any NACK or something else. Instead it will just receive nothing until the connection times out. This patch is meant to fix this behaviour.

michaelvonrhein commented 9 months ago

Had the same Problem and would totally appreciate more control over the thrown exception

davidweisgerber commented 7 months ago

@jamesagnew could you please have a look at this PR? This is a problem for one of our customers.

ProComFuchs commented 7 months ago

hi, it took me a long time to find out that the exception cannot be handled. I would be very happy about a quick solution.