Event fired when an error occurs during processing and before the connection is closed down.