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

Unified Diff: appengine/gaesettings/gaesettings.go

Issue 2951393002: [errors] de-specialize Transient in favor of Tags. (Closed)
Patch Set: more refactor Created 3 years, 6 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: appengine/gaesettings/gaesettings.go
diff --git a/appengine/gaesettings/gaesettings.go b/appengine/gaesettings/gaesettings.go
index 59933e836d7c24d2f80359aa3c1856e9374e721a..34fc02cf5c75bf89e0a56f238dc9452a817a6ef6 100644
--- a/appengine/gaesettings/gaesettings.go
+++ b/appengine/gaesettings/gaesettings.go
@@ -18,8 +18,8 @@ import (
ds "github.com/luci/gae/service/datastore"
"github.com/luci/gae/service/info"
"github.com/luci/luci-go/common/clock"
- "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/common/retry/transient"
"github.com/luci/luci-go/server/settings"
)
@@ -81,7 +81,7 @@ func (s Storage) FetchAllSettings(c context.Context) (*settings.Bundle, error) {
case err == ds.ErrNoSuchEntity:
break
case err != nil:
- return nil, errors.WrapTransient(err)
+ return nil, transient.Tag.Apply(err)
}
pairs := map[string]*json.RawMessage{}
@@ -151,7 +151,7 @@ func (s Storage) UpdateSetting(c context.Context, key string, value json.RawMess
if fatalFail != nil {
return fatalFail
}
- return errors.WrapTransient(err)
+ return transient.Tag.Apply(err)
}
// GetConsistencyTime returns "last modification time" + "expiration period".
@@ -169,6 +169,6 @@ func (s Storage) GetConsistencyTime(c context.Context) (time.Time, error) {
case ds.ErrNoSuchEntity:
return time.Time{}, nil
default:
- return time.Time{}, errors.WrapTransient(err)
+ return time.Time{}, transient.Tag.Apply(err)
}
}

Powered by Google App Engine
This is Rietveld 408576698