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

Side by Side Diff: logdog/client/cmd/logdog_butler/subcommand_stream.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
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « logdog/client/cmd/logdog_butler/subcommand_run.go ('k') | logdog/common/storage/archive/logdog_archive_test/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698