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

Unified Diff: milo/appengine/buildbot/buildinfo.go

Issue 2856273004: Milo: Increase test coverage for appengine/buildbot (Closed)
Patch Set: review Created 3 years, 7 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/appengine/buildbot/builder_test.go ('k') | milo/appengine/buildbot/buildinfo_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/buildinfo.go
diff --git a/milo/appengine/buildbot/buildinfo.go b/milo/appengine/buildbot/buildinfo.go
index d34b043b1a7f28584bec6d88141dd8c3a045b634..84d404ae01b2e03523e734ed7321fd0bd9185374 100644
--- a/milo/appengine/buildbot/buildinfo.go
+++ b/milo/appengine/buildbot/buildinfo.go
@@ -62,12 +62,15 @@ func (p *BuildInfoProvider) GetBuildInfo(c context.Context, req *milo.BuildInfoR
// Load the BuildBot build from datastore.
build, err := getBuild(c, req.MasterName, req.BuilderName, int(req.BuildNumber))
- if err != nil {
- if err == errBuildNotFound {
- return nil, grpcutil.Errf(codes.NotFound, "Build #%d for master %q, builder %q was not found",
- req.BuildNumber, req.MasterName, req.BuilderName)
- }
-
+ switch err {
+ case errBuildNotFound:
+ return nil, grpcutil.Errf(codes.NotFound, "Build #%d for master %q, builder %q was not found",
+ req.BuildNumber, req.MasterName, req.BuilderName)
+ case errNotAuth:
+ return nil, grpcutil.Unauthenticated
+ case nil:
+ // continue
+ default:
logging.WithError(err).Errorf(c, "Failed to load build info.")
return nil, grpcutil.Internal
}
« no previous file with comments | « milo/appengine/buildbot/builder_test.go ('k') | milo/appengine/buildbot/buildinfo_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698