| OLD | NEW |
| 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 main | 5 package main |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "os" | 8 "os" |
| 9 | 9 |
| 10 "github.com/luci/luci-go/common/errors" | 10 "github.com/luci/luci-go/common/errors" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 output, err := of.configOutput(a) | 85 output, err := of.configOutput(a) |
| 86 if err != nil { | 86 if err != nil { |
| 87 log.WithError(err).Errorf(a, "Failed to create output instance."
) | 87 log.WithError(err).Errorf(a, "Failed to create output instance."
) |
| 88 return runtimeErrorReturnCode | 88 return runtimeErrorReturnCode |
| 89 } | 89 } |
| 90 defer output.Close() | 90 defer output.Close() |
| 91 | 91 |
| 92 // Instantiate our Processor. | 92 // Instantiate our Processor. |
| 93 err = a.runWithButler(output, func(b *butler.Butler) error { | 93 err = a.runWithButler(output, func(b *butler.Butler) error { |
| 94 if err := b.AddStream(streamFile, cmd.stream.properties()); err
!= nil { | 94 if err := b.AddStream(streamFile, cmd.stream.properties()); err
!= nil { |
| 95 » » » return errors.Annotate(err).Reason("failed to add stream
").Err() | 95 » » » return errors.Annotate(err, "failed to add stream").Err(
) |
| 96 } | 96 } |
| 97 | 97 |
| 98 b.Activate() | 98 b.Activate() |
| 99 return b.Wait() | 99 return b.Wait() |
| 100 }) | 100 }) |
| 101 if err != nil { | 101 if err != nil { |
| 102 logAnnotatedErr(a, err, "Failed to stream file.") | 102 logAnnotatedErr(a, err, "Failed to stream file.") |
| 103 return runtimeErrorReturnCode | 103 return runtimeErrorReturnCode |
| 104 } | 104 } |
| 105 | 105 |
| 106 return 0 | 106 return 0 |
| 107 } | 107 } |
| OLD | NEW |