return { metadata, discoveryUrl: openidPathAdditionUrl, errors };
}
// If we've tried all URLs and none worked, throw the error(s)
if (errors.length === 1) {
throw errors[0];
throw new AggregateError(errors, 'Failed to fetch authorization server metadata from all attempted URLs');
}
}