Handles error events from connection