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

Side by Side Diff: logdog/common/storage/bigtable/bigtable.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 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 bigtable 5 package bigtable
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "time" 9 "time"
10 10
11 "cloud.google.com/go/bigtable" 11 "cloud.google.com/go/bigtable"
12 "golang.org/x/net/context" 12 "golang.org/x/net/context"
13 "google.golang.org/grpc/codes" 13 "google.golang.org/grpc/codes"
14 14
15 » "github.com/luci/luci-go/common/errors" 15 » "github.com/luci/luci-go/common/retry/transient"
16 "github.com/luci/luci-go/grpc/grpcutil" 16 "github.com/luci/luci-go/grpc/grpcutil"
17 "github.com/luci/luci-go/logdog/common/storage" 17 "github.com/luci/luci-go/logdog/common/storage"
18 ) 18 )
19 19
20 const ( 20 const (
21 logColumnFamily = "log" 21 logColumnFamily = "log"
22 22
23 // The data column stores raw low row data (RecordIO blob). 23 // The data column stores raw low row data (RecordIO blob).
24 logColumn = "data" 24 logColumn = "data"
25 logColName = logColumnFamily + ":" + logColumn 25 logColName = logColumnFamily + ":" + logColumn
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return nil 190 return nil
191 } 191 }
192 192
193 // For Apply, assume that anything other than InvalidArgument (bad data) is 193 // For Apply, assume that anything other than InvalidArgument (bad data) is
194 // transient. We exempt InvalidArgument because our data construction is 194 // transient. We exempt InvalidArgument because our data construction is
195 // deterministic, and so this request can never succeed. 195 // deterministic, and so this request can never succeed.
196 switch code := grpcutil.Code(err); code { 196 switch code := grpcutil.Code(err); code {
197 case codes.InvalidArgument: 197 case codes.InvalidArgument:
198 return err 198 return err
199 default: 199 default:
200 » » return errors.WrapTransient(err) 200 » » return transient.Tag.Apply(err)
201 } 201 }
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698