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

Create jbrowse error screen when resource fails to load #915

Merged
merged 5 commits into from
Feb 6, 2018

Conversation

cmdcolin
Copy link
Contributor

@cmdcolin cmdcolin commented Aug 2, 2017

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

screenshot-localhost-2017-08-02-10-01-24

@enuggetry enuggetry added the in progress currently being worked on label Aug 2, 2017
@nathandunn
Copy link
Contributor

Let me know when / if you need this tested.

@cmdcolin
Copy link
Contributor Author

cmdcolin commented Aug 2, 2017

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)

@hexylena
Copy link
Contributor

hexylena commented Aug 4, 2017

👍

@ghost ghost assigned rbuels Jan 30, 2018
console.error(error);
deferred.reject('A resource failed to load '+error.src + ':' + error.info[0]);
});

Copy link
Collaborator

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.

Copy link
Contributor Author

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)

Copy link
Contributor Author

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

@rbuels rbuels added this to the 1.12.4 milestone Jan 30, 2018
@rbuels rbuels added the bug this is a problem that needs to be fixed label Jan 30, 2018
@ghost ghost assigned cmdcolin Feb 1, 2018
@rbuels rbuels merged commit 33f932a into master Feb 6, 2018
@ghost ghost removed the in progress currently being worked on label Feb 6, 2018
@rbuels rbuels deleted the add_error_when_plugin_fails branch February 14, 2018 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug this is a problem that needs to be fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants