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

Unified Diff: logdog/appengine/coordinator/service.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: fix nits 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
« no previous file with comments | « logdog/appengine/coordinator/endpoints/logs/get.go ('k') | logdog/client/butler/output/logdog/output.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/appengine/coordinator/service.go
diff --git a/logdog/appengine/coordinator/service.go b/logdog/appengine/coordinator/service.go
index a12b96d3d282cf15f482b03418b1e42fc009b8c4..c5e51e398164aa366ff6b8065c4dac1db6b54326 100644
--- a/logdog/appengine/coordinator/service.go
+++ b/logdog/appengine/coordinator/service.go
@@ -508,13 +508,13 @@ func (si *googleStorage) Close() {
func (si *googleStorage) GetSignedURLs(c context.Context, req *URLSigningRequest) (*URLSigningResponse, error) {
info, err := si.svc.signer.ServiceInfo(c)
if err != nil {
- return nil, errors.Annotate(err).InternalReason("failed to get service info").Err()
+ return nil, errors.Annotate(err, "").InternalReason("failed to get service info").Err()
}
lifetime := req.Lifetime
switch {
case lifetime < 0:
- return nil, errors.Reason("invalid signed URL lifetime: %(lifetime)s").D("lifetime", lifetime).Err()
+ return nil, errors.Reason("invalid signed URL lifetime: %s", lifetime).Err()
case lifetime > maxSignedURLLifetime:
lifetime = maxSignedURLLifetime
@@ -537,8 +537,8 @@ func (si *googleStorage) GetSignedURLs(c context.Context, req *URLSigningRequest
doSign := func(path gs.Path) (string, error) {
url, err := gcst.SignedURL(path.Bucket(), path.Filename(), &opts)
if err != nil {
- return "", errors.Annotate(err).InternalReason("failed to sign URL").
- D("bucket", path.Bucket()).D("filename", path.Filename).Err()
+ return "", errors.Annotate(err, "").InternalReason(
+ "failed to sign URL: bucket(%s)/filename(%s)", path.Bucket(), path.Filename).Err()
}
return url, nil
}
@@ -546,14 +546,14 @@ func (si *googleStorage) GetSignedURLs(c context.Context, req *URLSigningRequest
// Sign stream URL.
if req.Stream {
if resp.Stream, err = doSign(si.stream); err != nil {
- return nil, errors.Annotate(err).InternalReason("failed to sign stream URL").Err()
+ return nil, errors.Annotate(err, "").InternalReason("failed to sign stream URL").Err()
}
}
// Sign index URL.
if req.Index {
if resp.Index, err = doSign(si.index); err != nil {
- return nil, errors.Annotate(err).InternalReason("failed to sign index URL").Err()
+ return nil, errors.Annotate(err, "").InternalReason("failed to sign index URL").Err()
}
}
« no previous file with comments | « logdog/appengine/coordinator/endpoints/logs/get.go ('k') | logdog/client/butler/output/logdog/output.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698