Skip to content

Commit

Permalink
Added err handler in compression
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkerens authored and Rens Rikkerink committed Mar 1, 2019
1 parent 512f5e0 commit 563197b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ func (c *compressionReadWriter) writeVariable(w io.Writer, v reflect.Value) erro
return err
}

if err := handleVariableWriter(z, c.handler, v); err != nil {
if err = handleVariableWriter(z, c.handler, v); err != nil {
return err
}
if err = z.Close(); err != nil {
return err
}
z.Close()

lb := make([]byte, 4)
binary.BigEndian.PutUint32(lb, uint32(b.Len()))
if _, err := w.Write(lb); err != nil {
if _, err = w.Write(lb); err != nil {
return err
}
if _, err = w.Write(b.Bytes()); err != nil {
Expand Down

0 comments on commit 563197b

Please sign in to comment.