-
Notifications
You must be signed in to change notification settings - Fork 199
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
Create jbrowse error screen when resource fails to load #915
Conversation
Let me know when / if you need this tested. |
I think it is probably done for the case I was interested in, namely the plugin failing to load. There are actually other cases such as the storeClass and trackType not loading correctly, and adding error handlers for those would be useful too (they do not give any good indication of failing on the screen, only and error via the javascript console) |
👍 |
src/JBrowse/Browser.js
Outdated
console.error(error); | ||
deferred.reject('A resource failed to load '+error.src + ':' + error.info[0]); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you de-install this error handler after the plugin loading is finished? It's specific to the plugin loading, and require
is a persistent global thing.
If something else fails to load later, it will try again to reject the plugin-loading deferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found from this thread that it can return a handle that can be used to later remove it dojo/loader#14
This allows the glyph error handler to be separate at the later stage (added that too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is reverted now, I think just having a global require.on error handler in index.html that creates an error screen sort of a better approach. Potentially this is a downside because if one track fails to load it just jumps to the error screen rather than just continuing to display other tracks, but the idea of adding and removing the error handler didnt seem to be working.
Also the "not-a-module" error can be caught now
1b192e8
to
56af3e3
Compare
When a plugin that is specified by jbrowse config fails to load due to not being located e.g. 404, the result seems to be a blank white screen which is hard to debug. This adds an error handler that tries to clarify that by giving an error screen that looks like this now