Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2373)

Unified Diff: appengine/swarming/ui/res/imp/botpage/bot-page-data.html

Issue 2470973003: give user notification if bot or task not found (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/swarming/ui/res/imp/botpage/bot-page-data.html
diff --git a/appengine/swarming/ui/res/imp/botpage/bot-page-data.html b/appengine/swarming/ui/res/imp/botpage/bot-page-data.html
index 52e00f85a4ef203df8a243bfdd4f620ea63d78e7..1030bd34960a4ef9d4c6ebbfdfc75287b5c92824 100644
--- a/appengine/swarming/ui/res/imp/botpage/bot-page-data.html
+++ b/appengine/swarming/ui/res/imp/botpage/bot-page-data.html
@@ -97,6 +97,11 @@
computed: "_parseBot(_bot)",
notify: true,
},
+ bot_exists: {
+ type: Boolean,
+ value: true,
+ notify: true,
+ },
// private
_busy1: {
@@ -129,8 +134,17 @@
lastRequest = this.async(function(){
lastRequest = undefined;
var baseUrl = "/api/swarming/v1/bot/"+this.bot_id;
- this._getJsonAsync("_bot", baseUrl + "/get",
+ var p = this._getJsonAsync("_bot", baseUrl + "/get",
"_busy1", this.auth_headers);
+ p.then(function(){
+ this.set("bot_exists", true);
+ }.bind(this)).catch(function(r){
+ if (r.status === 404) {
+ this.set("bot_exists", false);
+ } else {
+ sk.errorMessage("Http response: " + (r.status || " ") + " " + r.response);
+ }
+ }.bind(this));
this.fire("reload", {id: this.bot_id});
}, BOT_ID_DEBOUNCE_MS);
« no previous file with comments | « appengine/swarming/ui/res/imp/botpage/bot-page.html ('k') | appengine/swarming/ui/res/imp/common/common-behavior.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698