OLD | NEW |
1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package deps | 5 package deps |
6 | 6 |
7 import ( | 7 import ( |
8 "github.com/luci/luci-go/common/errors" | 8 "github.com/luci/luci-go/common/errors" |
9 "github.com/luci/luci-go/grpc/grpcutil" | 9 "github.com/luci/luci-go/grpc/grpcutil" |
10 "google.golang.org/grpc/codes" | 10 "google.golang.org/grpc/codes" |
11 ) | 11 ) |
12 | 12 |
13 func grpcAnnotate(err error, code codes.Code) *errors.Annotator { | 13 func grpcAnnotate(err error, code codes.Code, reason string, args ...interface{}
) *errors.Annotator { |
14 » return errors.Annotate(err).Tag(grpcutil.Tag.With(code)) | 14 » return errors.Annotate(err, reason, args...).Tag(grpcutil.Tag.With(code)
) |
15 } | 15 } |
OLD | NEW |