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

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

Issue 2856273004: Milo: Increase test coverage for appengine/buildbot (Closed)
Patch Set: Imports, headers 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
Index: milo/appengine/buildbot/buildinfo.go
diff --git a/milo/appengine/buildbot/buildinfo.go b/milo/appengine/buildbot/buildinfo.go
index d34b043b1a7f28584bec6d88141dd8c3a045b634..d200cf4195e3e73132956fdfa455bf392dbbb52c 100644
--- a/milo/appengine/buildbot/buildinfo.go
+++ b/milo/appengine/buildbot/buildinfo.go
@@ -62,14 +62,18 @@ 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
+
nodir 2017/05/26 18:33:05 nit: not sure why this blank line is here
Ryan Tseng 2017/05/26 22:49:22 Done.
}
// Create a new LogDog client.

Powered by Google App Engine
This is Rietveld 408576698