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