moov-io / iso8583

A golang implementation to marshal and unmarshal iso8583 message.
https://moov.io
Apache License 2.0
304 stars 100 forks source link

add pack/unpack errors #249

Closed alovak closed 11 months ago

alovak commented 11 months ago

With this PR we introduce two error types so it's possible to know up the stack that the error is related to message packing or unpacking.

Here are two types:

UnpackError, when unwrapped, lets you access the raw message data so you can store it and inspect it later.

Introducing these error types resolves the issue with iso8583-connection, when errors when a message can't be packed or unpacked should be handled separately from other types of errors.