Fixed bug in error handler on socket

Fixed a bug in the error handler on a socket/decoding exception.