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

Side by Side Diff: logdog/client/cli/subcommandLatest.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: fix nits 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
« no previous file with comments | « logdog/client/cli/subcommandCat.go ('k') | logdog/client/cli/subcommandList.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 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 cli 5 package cli
6 6
7 import ( 7 import (
8 "io" 8 "io"
9 "os" 9 "os"
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 log.ErrorKey: err, 67 log.ErrorKey: err,
68 "project": addr.Project, 68 "project": addr.Project,
69 "path": addr.Path, 69 "path": addr.Path,
70 }.Errorf(a, "Invalid command-line stream path.") 70 }.Errorf(a, "Invalid command-line stream path.")
71 return 1 71 return 1
72 } 72 }
73 } 73 }
74 74
75 coord, err := a.coordinatorClient(addr.Host) 75 coord, err := a.coordinatorClient(addr.Host)
76 if err != nil { 76 if err != nil {
77 » » errors.Log(a, errors.Annotate(err).Reason("failed to create Coor dinator client").Err()) 77 » » errors.Log(a, errors.Annotate(err, "failed to create Coordinator client").Err())
78 return 1 78 return 1
79 } 79 }
80 80
81 stream := coord.Stream(addr.Project, addr.Path) 81 stream := coord.Stream(addr.Project, addr.Path)
82 82
83 tctx, _ := a.timeoutCtx(a) 83 tctx, _ := a.timeoutCtx(a)
84 le, st, err := cmd.getTailEntry(tctx, stream) 84 le, st, err := cmd.getTailEntry(tctx, stream)
85 if err != nil { 85 if err != nil {
86 log.Fields{ 86 log.Fields{
87 log.ErrorKey: err, 87 log.ErrorKey: err,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if ar := <-clock.After(c, noStreamDelay); ar.Incomplete( ) { 126 if ar := <-clock.After(c, noStreamDelay); ar.Incomplete( ) {
127 // Timer stopped prematurely. 127 // Timer stopped prematurely.
128 return nil, nil, ar.Err 128 return nil, nil, ar.Err
129 } 129 }
130 130
131 default: 131 default:
132 return nil, nil, err 132 return nil, nil, err
133 } 133 }
134 } 134 }
135 } 135 }
OLDNEW
« no previous file with comments | « logdog/client/cli/subcommandCat.go ('k') | logdog/client/cli/subcommandList.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698