def _get_v1_error_from_json(_json_error, _fail_on_no_results):
    """This function extracts error details (if present) from a Community API v1 response.

    :param _json_error: The API response in JSON format
    :type _json_error: dict
    :param _fail_on_no_results: Defines if an exception should be raised if no results are returned
    :type _fail_on_no_results: bool
    :returns: A Boolean stating if an error was found and a tuple with the error code and error/exception messages
    """
    _error_code, _error_msg, _exc_msg = 0, '', ''
    _error_found = True if _json_error['status'] == 'error' else False
    if _error_found:
        _error_code = _json_error['error']['code']
        _error_msg = _json_error['error']['message']
        _exc_msg = (
            f"The Community API v1 call failed with the error code '{_error_code}' and the following "
             + f'message: {_error_msg}')
    _inner_response = _json_error[list(_json_error.keys())[1]]
    if len(_inner_response[list(_inner_response.keys())[0]]) == 0:
        _error_found = _fail_on_no_results
        _error_code = 404
        _error_msg = f'The Community API v1 call returned no results.'
        _exc_msg = _error_msg
    return _error_found, (_error_code, _error_msg, _exc_msg)
