Chromium Code Reviews| 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. |