<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mark_error(self, dispatch, error_log, message_cls):
 """Marks a dispatch as having error or consequently as failed if send retry limit for that message type is exhausted. Should be used within send(). :param Dispatch dispatch: a Dispatch :param str error_log: error message :param MessageBase message_cls: MessageBase heir """

        if message_cls.send_retry_limit is not None and (dispatch.retry_count + 1) >= message_cls.send_retry_limit:
            self.mark_failed(dispatch, error_log)
        else:
            dispatch.error_log = error_log
            self._st['error'].append(dispatch)