moov-io / iso8583-connection

:satellite: Go-powered ISO8583 connection handler offering advanced binary framing, message interleaving, and a robust connection pool for load distribution and seamless reconnections.
Apache License 2.0
70 stars 23 forks source link

Report err from OnClose and Close Connection Regardless of the Error #78

Closed alovak closed 6 months ago

alovak commented 6 months ago

Currently, when we return err from the OnClose or OnCloseCtx handler, we do not close the connection. Leaking connections is a big problem. With this PR, we pass err into ErrorHandler so it can be handled, logged, etc., and then proceed with the connection close.