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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(report): edge Invalid argument error #6456

Merged
merged 2 commits into from
Nov 2, 2018
Merged

fix(report): edge Invalid argument error #6456

merged 2 commits into from
Nov 2, 2018

Conversation

wardpeet
Copy link
Collaborator

@wardpeet wardpeet commented Nov 2, 2018

Summary
Seo font-size audit has a 'Legible Text' value in an url column. Inside the report we run new URL('Legible Text'); which throws an error in all browsers. We catch it by checking e.name is typeError. Edge just throws an Error with Invalid Argument as a message. We now support both.

Related Issues/PRs
#6444

@wardpeet
Copy link
Collaborator Author

wardpeet commented Nov 2, 2018

Issue:
edge error

Demo:
edge load

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

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

thanks for digging into this, @wardpeet !

I'm thinking we could perhaps avoid this dance entirely.

@@ -127,7 +127,8 @@ class DetailsRenderer {
displayedHost = parsed.file === '/' ? '' : `(${parsed.hostname})`;
title = url;
} catch (/** @type {!Error} */ e) {
if (!e.name.startsWith('TypeError')) {
// All browsers throw a TypeError except Edge they throw a regular Error with Invalid argument as a message
if (!e.name.startsWith('TypeError') && !e.message.startsWith('Invalid argument')) {
Copy link
Member

Choose a reason for hiding this comment

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

i think we could afford to remove this if (...) { throw e; } block entirely.

Here's the history:

  1. Total byte audit reports full URL #2312 (comment)
  2. tests: move cli/core to jest #5386 (comment)

From what I can tell, we might as well just discard any exception here. Throwing at this point seems.. bad. :)

@patrickhulce sgty?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i'm fine with that! :)

@paulirish paulirish merged commit f88237d into master Nov 2, 2018
@paulirish paulirish deleted the bug/report-edge branch November 2, 2018 22:46
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.

2 participants