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

[uiAppTemplate] display errors on screen when resources fail to load #5870

Merged
merged 2 commits into from
Jan 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/ui/views/ui_app.jade
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,25 @@ block content
var file = files.shift();
if (!file) return;

var failure = function () {
// make subsequent calls to failure() noop
failure = function () {};

var err = document.createElement('h1');
err.style['color'] = 'white';
err.style['font-family'] = 'monospace';
err.style['text-align'] = 'center';
err.style['background'] = '#F44336';
err.style['padding'] = '25px';
err.innerText = 'Kibana did not load properly. Check the server output for more information.';

document.body.innerHTML = err.outerHTML;
}

var type = /\.js(\?.+)?$/.test(file) ? 'script' : 'link';
var dom = document.createElement(type);
dom.setAttribute('async', '');
dom.addEventListener('error', failure);

if (type === 'script') {
dom.setAttribute('src', file);
Expand Down