Skip to content

Commit 29adea8

Browse files
committed
core/commands: fix error in cat
1 parent 26a9ad0 commit 29adea8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/commands/cat.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,15 @@ var CatCmd = &cmds.Command{
7070
re.SetLength(length)
7171

7272
reader := io.MultiReader(readers...)
73+
// Since the reader returns the error that a block is missing, we need to take
74+
// Emit errors and send them to the client. Usually we don't do that because
75+
// it means the connection is broken or we supplied an illegal argument etc.
7376
err = re.Emit(reader)
7477
if err != nil {
75-
log.Error(err)
78+
err = re.SetError(err, cmdsutil.ErrNormal)
79+
if err != nil {
80+
log.Error(err)
81+
}
7682
}
7783
re.Close()
7884
},

0 commit comments

Comments
 (0)