def METHOD_NAME(path, name):
    api_path = os.path.join(path, name)
    try:
        capi.load_api(api_path)
        return api_path
    except Exception as e:
        b_outdated_ansys_version_found = False
        b_module_not_found = False
        for arg in e.args:
            if hasattr(e, "winerror"):
                # if on Windows, we can check the error code
                # cases where the OSError is just saying "module not found"
                # without specifying the path
                if e.winerror == 126 and _find_outdated_ansys_version(path):
                    b_module_not_found = True
                    break
            if isinstance(arg, str):
                if (
                        len(arg) > 3
                ):  # at least 4 characters to have v*** defined, e.g. v221
                    if _find_outdated_ansys_version(arg):
                        b_outdated_ansys_version_found = True
        if b_outdated_ansys_version_found or b_module_not_found:
            raise errors.DpfVersionNotSupported("4.0")
        else:
            if not os.path.isdir(path):
                raise NotADirectoryError(
                    f'Unable to locate the directory containing DPF at '
                    f'"{path}"'
                )
            elif not os.path.isfile(api_path):
                raise FileNotFoundError(
                    f'DPF file not found at "{api_path}".  '
                    f'Unable to locate the following file: "{name}"'
                )
            else:
                raise e