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

Unified Diff: appengine/swarming/ui/res/imp/common/common-behavior.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/common/common-behavior.html
diff --git a/appengine/swarming/ui/res/imp/common/common-behavior.html b/appengine/swarming/ui/res/imp/common/common-behavior.html
index 68712d51a2f3dc7b1db7eaa7f64c166f56602a4b..73560838b9602be758eda800dfdfe384d5f85914 100644
--- a/appengine/swarming/ui/res/imp/common/common-behavior.html
+++ b/appengine/swarming/ui/res/imp/common/common-behavior.html
@@ -59,9 +59,12 @@
// set to true while the request is in flight and false afterwards.
// request headers (e.g. authentication) and query params will be used if
// provided. Query params is an object like {String:Array<String>}. On
- // error, bindTo will be set to false. It is not set to undefined
- // because computed values in Polymer don't fire if a property is
- // undefined. Clients should check that bindTo is not falsey.
+ // error, bindTo will be set to false and the promise will be rejected
+ // with {status:Number, reason:String} where the reason is the text
+ // returned from the server.
+ // The object bindTo is not set to undefined because computed values in
+ // Polymer don't fire if a property is undefined. Clients should check
+ // that bindTo is not falsey.
// To avoid multiple requests clobering one another, an object _jsonAsync
// is created on "this" to debounce requests - the most recent request
// will win out.
@@ -77,7 +80,7 @@
if (params) {
url = url + "?" + sk.query.fromParamSet(params);
}
- sk.request("GET", url, "", headers).then(JSON.parse).then(function(json){
+ return sk.request("GET", url, "", headers).then(JSON.parse).then(function(json){
if (this._jsonAsync[bindTo] !== now) {
console.log("ignoring result because a second request happened.");
this.set(busy, false);
@@ -95,6 +98,7 @@
}
this.set(bindTo, false);
this.set(busy, false);
+ return Promise.reject(reason);
}.bind(this));
},
« no previous file with comments | « appengine/swarming/ui/res/imp/botpage/bot-page-data.html ('k') | appengine/swarming/ui/res/imp/taskpage/task-page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698