Skip to content

Commit 7b2844d

Browse files
committed
Catch and rewrite error
1 parent 0cd070c commit 7b2844d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

provisionersdk/archive.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ func Tar(w io.Writer, directory string, limit int64) error {
115115
return data.Close()
116116
})
117117
if err != nil {
118+
if xerrors.Is(err, xio.ErrLimitReached) {
119+
return xerrors.Errorf("Archive too big. Must be <= %d bytes", limit)
120+
}
118121
return err
119122
}
120123
err = tarWriter.Flush()

0 commit comments

Comments
 (0)