'Handles an error during packet processing.
:param error_code: The error code.'

def _handle_error(self, session, error_code, error_msg=''):

    session.is_failed = True
    msg = (error_msg if error_msg else ERROR_DICT.get(error_code, error_msg))
    self._send_error_packet(session, error_code, msg)
