Open Bug 1760705 Opened 3 years ago Updated 3 years ago

Improve error messages when the debugger failed loading a source text content

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: ochameau, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

There is many edgecases where the debugger fails displaying the source text content, while list the source correctly in the source tree.
It can be confusing to understand why it fails and often, the displayed error isn't helpful.
That's unfortunate as in most cases, the user should reload the page to have the source loading correctly.

It would be nice to have explicit error message that explain the issue and may be also have a reload button to easily address the issue.

Here is a few cases where we have such error:

  • the source was garbaged collected before we opened the debugger (happen for regular JS as well as ASM.js and WASM)
  • ASM.js and WASM debugging is disabled before devtools is opened, so any such type of source loaded before opening the debugger will fail loading
  • the source is an HTML file and for this we issue a new cached http request, but if the http server respond with an http error, the source will fail loading
  • we rejected loading the source because of its protocol

The thread actor/sources manager reject the source loading for various reason, I might have missed some particular edgecase in this list.

The following test already cover a few case where the source context failed loading:
https://searchfox.org/mozilla-central/source/devtools/client/debugger/test/mochitest/browser_dbg-features-source-text-content.js
Bug 1760702 is going to cover some more cases.
So we should have the test coverage already done. It should be only about adding nice message and may be tweaking the UI.

You need to log in before you can comment on or make changes to this bug.