mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
transform: Return any read or write error from Apply
This commit is contained in:
parent
3a86aba517
commit
0cd0adda20
1 changed files with 8 additions and 4 deletions
|
@ -69,10 +69,14 @@ func (c *chain) Apply(w io.Writer, r io.Reader, p []byte) error {
|
||||||
b1 := bp.GetBuffer()
|
b1 := bp.GetBuffer()
|
||||||
defer bp.PutBuffer(b1)
|
defer bp.PutBuffer(b1)
|
||||||
|
|
||||||
b1.ReadFrom(r)
|
if _, err := b1.ReadFrom(r); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if len(*c) == 0 {
|
if len(*c) == 0 {
|
||||||
b1.WriteTo(w)
|
if _, err := b1.WriteTo(w); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +101,6 @@ func (c *chain) Apply(w io.Writer, r io.Reader, p []byte) error {
|
||||||
tr(fb)
|
tr(fb)
|
||||||
}
|
}
|
||||||
|
|
||||||
fb.to.WriteTo(w)
|
_, err := fb.to.WriteTo(w)
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue