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

Unified Diff: scheduler/appengine/ui/job.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/ui/invocation.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scheduler/appengine/ui/job.go
diff --git a/scheduler/appengine/ui/job.go b/scheduler/appengine/ui/job.go
index ebc617215ee2412b724b818e90b988b47d6c81bb..2bbe8abaaf20dada5c4c8633c22b359a37d3792a 100644
--- a/scheduler/appengine/ui/job.go
+++ b/scheduler/appengine/ui/job.go
@@ -37,12 +37,12 @@ func jobPage(ctx *router.Context) {
// Grab the job from the datastore.
job, err := config(c).Engine.GetVisibleJob(c, projectID+"/"+jobName)
- if err != nil {
- panic(err)
- }
- if job == nil {
+ switch {
+ case err == engine.ErrNoSuchJob:
http.Error(w, "No such job or no access to it", http.StatusNotFound)
return
+ case err != nil:
+ panic(err)
}
// Grab latest invocations from the datastore.
« no previous file with comments | « scheduler/appengine/ui/invocation.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698