Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
clarify connection and error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
shekenahglory committed Jul 28, 2016
1 parent 392b2eb commit 2df27de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
21 changes: 14 additions & 7 deletions src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,20 @@ angular.element(document).ready(function() {

function checkStatus() {
d = api.getMaintenanceStatus(function(err, resp) {
var mode;
var html;
var style;
var mode = 'maintenance';
var title = 'This site is under maintenance.'
var html = '';
var style = '';
var height;

if (err) {
console.log(err);
mode = 'maintenance';
html = err.message;
style = '';
if (err.status === 0) {
title = 'Unable to connect to the data service.'
} else {
title = err.message || err.text;
html += err.status
}

} else {
mode = resp && resp.mode ? resp.mode : 'normal';
Expand All @@ -204,7 +208,10 @@ angular.element(document).ready(function() {

// show maintenance
if (mode === 'maintenance') {
maintenance.select('.message')
maintenance.select('.title')
.html(title);

maintenance.select('.subtitle')
.html(html);

maintenance
Expand Down
2 changes: 1 addition & 1 deletion src/common/apiHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ ApiHandler = function (baseURL) {
xhr.abort();
callback({
status: 500,
message: 'Data Response Timeout'
text: 'Data Response Timeout'
});
}, 15000);

Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
</div>
<div id="maintenance">
<div class="logo"></div>
<h3>This site is under maintenance.</h3>
<div class="message"></div>
<h3 class="title"></h3>
<div class="subtitle"></div>
</div>
<div class="header">
<div class="banner-wrap">
Expand Down

0 comments on commit 2df27de

Please sign in to comment.