Skip to content

Commit

Permalink
Show alert when metric couldn't be loaded. (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
chovanecm committed Jul 7, 2017
1 parent 0396265 commit f12bfa1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sacredboard/static/scripts/runs/metricsViewer/ProxiedMetric.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,21 @@ define(["runs/Metric", "knockout", "jquery"], function (Metric, ko, $) {
}));
self._fetched = true;
self._fetchingInProgress = false;
});
}).fail(function (jqxhr, textStatus, error) {self.onLoadFail(textStatus, error, self.name());});
}

/**
* Trigger when the metric couldn't be loaded.
*
* @param textStatus
* @param error
* @param {string} name - Name of the metric that have failed to load.
*/
onLoadFail(textStatus, error, name) {
/* override the method if possible */
alert("Error when loading metric " + name + ".\nError message: " + textStatus + "\nError:" + error);
};

}
return ProxiedMetric;
});

0 comments on commit f12bfa1

Please sign in to comment.