Permalink
Browse files

If /supported returns a 500 then update error

  • Loading branch information...
beaucollins committed May 1, 2012
1 parent 61a4402 commit dcee63b9c2a2cceff928c76e8def03a5865fc377
Showing with 10 additions and 6 deletions.
  1. +10 −6 public/app.js
View
@@ -191,13 +191,17 @@ var loadSite = function(src){
xhr.open('GET', '/supported?url=' + src);
xhr.addEventListener('readystatechange', function(e){
var response;
- if (xhr.readyState == 4) {
- response = JSON.parse(xhr.responseText);
- if (response['x-frame-options'] !== false) {
- loadIndicator.classList.add('error');
- p.textContent = "Load Error: forbidden by X-Frame-Options HTTP response header."
+ if (xhr.status == 500) {
+ p.textContent = "Host unreachable from server."
+ } else {
+ if (xhr.readyState == 4) {
+ response = JSON.parse(xhr.responseText);
+ if (response['x-frame-options'] !== false) {
+ loadIndicator.classList.add('error');
+ p.textContent = "Load Error: forbidden by X-Frame-Options HTTP response header."
+ };
};
- };
+ }
});
xhr.send("")
};

0 comments on commit dcee63b

Please sign in to comment.