Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃攰 [RUMF-1281] Collect more detail on failing URL build telemetry #2062

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

amortemousque
Copy link
Contributor

Motivation

URL normalization used for xhr and fetch uses location.origin as a base. In certain cases the normalisation fails because the location.origin seem malformed.

Changes

Collect the url and base used for the normalization

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@amortemousque amortemousque requested a review from a team as a code owner March 7, 2023 20:11
try {
return base !== undefined ? new URL(url, base) : new URL(url)
} catch (error) {
throw new Error(`Failed to construct URL. ${jsonStringify({ url, base })!}`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What did I chose to throw a custom error over addTelemetryError:

  • addTelemetryError creates a circular reference
  • using addTelemetryError would also mean
    • to re throw the error and have two monitoring errors for the same thing
    • or to return undefined and handling this case which I don't want

So let's be simple

@amortemousque amortemousque merged commit c466c8f into main Mar 30, 2023
@amortemousque amortemousque deleted the aymeric/investigate-invalid-base-url branch March 30, 2023 09:23
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.

None yet

3 participants