fix(cmd/gc): Run func does not return error when Emit func returns error
License: MIT Signed-off-by: chenminjian <727180553@qq.com>
chenminjian committed
Oct 29, 2018 at 15:49 UTC
78d878e253985ffd9fc5e2258de3fa41be49def9
1 file changed
+6
-2
core/commands/repo.go
+6
-2
@@ -83,10 +83,14 @@ order to reclaim hard disk space.
83
errs := false
84
for res := range gcOutChan {
85
if res.Error != nil {
86
- re.Emit(&GcResult{Error: res.Error.Error()})
86
+ if err := re.Emit(&GcResult{Error: res.Error.Error()}); err != nil {
87
+ return err
88
+ }
89
errs = true
90
} else {
89
- re.Emit(&GcResult{Key: res.KeyRemoved})
91
+ if err := re.Emit(&GcResult{Key: res.KeyRemoved}); err != nil {
92
+ return err
93
+ }
94
}
95
}
96
if errs {