Skip to content

Conversation

ekremney
Copy link
Member

@ekremney ekremney commented Mar 14, 2025

[to be merged after the code freeze]

This PR introduces human readable error messages for the failed RUM Bundler API calls.

For example:

Error: Query 'cwv' failed. Opts: {"domain":"www.domain.com","interval":7,"granularity":"hourly"}.
--> Reason: Error fetching data from https://bundles.aem.page/bundles/www.domain.com/2025/03/13/14?domainkey=redacted: Request to https://bundles.aem.page/bundles/www.domain.com/2025/03/13/14?domainkey=redacted failed with status 500

@ekremney ekremney changed the title feat(rum-api-client): human readable error messages for the failed bundler api calls fix(rum-api-client): human readable error messages for the failed bundler api calls Mar 14, 2025
Copy link

This PR will trigger a minor release when merged.

@ekremney ekremney requested a review from a team March 14, 2025 11:43
try {
return await response.json();
} catch (error) {
throw new Error(`Error parsing JSON from ${sanitizeURL(response.url)}: ${error.message}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekremney does this bubble up the error to the caller? Can we record all the failed urls and return the list of failed urls along with fetched bundles? Or can we introduce ignoreErrors option and ignore the errors and return the fetched bundles only? I don't want to fail the entire RUM bundles request if we can't get some bundles.. in almost all of the scenarios we're ok to calculate the insights we need with available data.

@lenaorobei
Copy link

@ekremney any chance you can look into Ravi's suggestion in the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants