question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feature-request: add reason to runtime error output

See original GitHub issue

Feature request summary

When a FAILED_DOCUMENT_REQUEST error occurs the error message does not give the actual reason for this as it’s not part of the stack trace for example:

Runtime error encountered: Your page failed to load. Verify that the URL is valid and re-run Lighthouse. LHError: FAILED_DOCUMENT_REQUEST at Function.getPageLoadError (/lighthouse/lighthouse-core/gather/gather-runner.js:168:21) at Function.afterPass (/lighthouse/lighthouse-core/gather/gather-runner.js:273:38) at process._tickCallback (internal/process/next_tick.js:68:7)

I am proposing to add the actual reason be displayed (if available) from the error, for example:

Runtime error encountered: Your page failed to load. Verify that the URL is valid and re-run Lighthouse. Reason: net::ERR_CERT_COMMON_NAME_INVALID LHError: FAILED_DOCUMENT_REQUEST at Function.getPageLoadError (/lighthouse/lighthouse-core/gather/gather-runner.js:168:21) at Function.afterPass (/lighthouse/lighthouse-core/gather/gather-runner.js:273:38) at process._tickCallback (internal/process/next_tick.js:68:7)

I am willing to do the work to add this.

What is the motivation or use case for changing this?

Being able to determine what the actual error that caused the page to fail to load would better help me explain to my users why the audit failed.

How is this beneficial to Ligthhouse?

Better diagnostics for developers that use the CLI to programatically audit.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
patrickhulcecommented, Aug 15, 2018

Oh yeah that was mostly for Sentry coalescing on the error message. In most of the cases we did this I think it was a win to not give so much debugging info to users who are confused, but in this case I agree it is a bit of a loss. I think it’d make sense to show the real reason here too 👍

Maybe we could do a transform of errors before sending them into the LHR? i.e. if the error has a .reason property then make it the message and stick the message into parens or something?

1reaction
paulirishcommented, Aug 15, 2018

@patrickhulce do you remember why we moved the errorReason from the Error’s message into a property?

@samfoot At the very least showRuntimeError in the CLI could also log error.reason. But I also think it’s reasonable to change the message based on the errorReason. Let’s see what patrick sez…

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature request] Show browser error overlay for runtime errors
I really like the browser error overlay that we get for compile errors (server.hmr.overlay). But runtime errors still appear only in console ...
Read more >
Runtime Error: What It Is and How to Fix It - Lifewire
Runtime errors prevent a program from working properly. Here's how to fix runtime errors caused my memory issues, unpatched bugs, and more.
Read more >
Runtime errors in Internet Explorer - Browsers - Microsoft Learn
Runtime errors can be caused when a website uses HTML code that's incompatible with the web browser functionality.
Read more >
Syntax Error - an overview | ScienceDirect Topics
Syntax errors are mistakes in the source code, such as spelling and punctuation errors, incorrect labels, and so on, which cause an error...
Read more >
Runtime error catalog | Apigee Edge
Error message: Decompression failure at request. Possible cause: This error occurs only if: The encoding specified in the HTTP request ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found