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

Unified Diff: scheduler/appengine/ui/invocation.go

Issue 2993933002: scheduler ACLs: improve ACL-related error handling in UI and API. (Closed)
Patch Set: rebase Created 3 years, 4 months 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
« no previous file with comments | « scheduler/appengine/engine/engine.go ('k') | scheduler/appengine/ui/job.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scheduler/appengine/ui/invocation.go
diff --git a/scheduler/appengine/ui/invocation.go b/scheduler/appengine/ui/invocation.go
index 227a3df0470509eea5fd41970e0a579c7b8fce75..e221da227a3d980e17913485db5b0e0bed1d249e 100644
--- a/scheduler/appengine/ui/invocation.go
+++ b/scheduler/appengine/ui/invocation.go
@@ -56,16 +56,16 @@ func invocationPage(c *router.Context) {
// panic on internal datastore errors to trigger HTTP 500.
switch {
+ case err2 == engine.ErrNoSuchJob:
+ http.Error(c.Writer, "No such job or no permission", http.StatusNotFound)
+ return
+ case err1 == engine.ErrNoSuchInvocation:
+ http.Error(c.Writer, "No such invocation", http.StatusNotFound)
+ return
case err1 != nil:
panic(err1)
case err2 != nil:
panic(err2)
- case inv == nil:
- http.Error(c.Writer, "No such invocation", http.StatusNotFound)
- return
- case job == nil:
- http.Error(c.Writer, "No such job", http.StatusNotFound)
- return
}
jobUI := makeJob(c.Context, job)
« no previous file with comments | « scheduler/appengine/engine/engine.go ('k') | scheduler/appengine/ui/job.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698