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

Unified Diff: milo/buildsource/buildbot/master.go

Issue 2977863002: [milo] Refactor all html knowledge out of backends. (Closed)
Patch Set: now with case insensitivity Created 3 years, 5 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 | « milo/buildsource/buildbot/html_test.go ('k') | milo/buildsource/buildbucket/builder.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/buildsource/buildbot/master.go
diff --git a/milo/buildsource/buildbot/master.go b/milo/buildsource/buildbot/master.go
index 09fcfc762fedd18e5d8e79423bf6dea7533a374f..7abda4ea890a724a7b8e74cc46e568c1a81b07fc 100644
--- a/milo/buildsource/buildbot/master.go
+++ b/milo/buildsource/buildbot/master.go
@@ -23,6 +23,7 @@ import (
"time"
ds "github.com/luci/gae/service/datastore"
+ "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/milo/api/resp"
"github.com/luci/luci-go/milo/common"
@@ -70,11 +71,12 @@ func canAccessMaster(c context.Context, name string) error {
if anon {
// They need to log in before we can tell them more stuff.
- return errNotAuth
+ return errors.New("public master not found", common.CodeUnauthorized)
+
}
// They are logged in but have no access, so tell them it's missing.
- return errMasterNotFound
+ return errors.New("master not found", common.CodeNotFound)
}
// getMasterEntry feches the named master and does an ACL check on the
@@ -88,7 +90,7 @@ func getMasterEntry(c context.Context, name string) (*buildbotMasterEntry, error
entry := buildbotMasterEntry{Name: name}
err := ds.Get(c, &entry)
if err == ds.ErrNoSuchEntity {
- err = errMasterNotFound
+ return nil, errors.New("master not found", common.CodeNotFound)
}
return &entry, err
}
« no previous file with comments | « milo/buildsource/buildbot/html_test.go ('k') | milo/buildsource/buildbucket/builder.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698