OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |