def serialize_cqrs_exception(exc):
    """Serialize CQRS exception.

    :param exc: exception
    :type exc: CQRSExcpetion
    :return: errors
    :rtype: list
    """
    if len(exc.args) == 2:
        return [{'title': f'{exc.args[0]}', 'code': f'{exc.args[1]}'}]
    else:
        return [{'title': f'{exc}'}]
