handling context timeout/cancelled in printer package

This commit is contained in:
Julien Neuhart
2019-07-09 19:39:14 +02:00
parent 957b9b1cf4
commit c7ecdcf625
9 changed files with 81 additions and 61 deletions

View File

@@ -43,7 +43,7 @@ func (p *office) Print(destination string) error {
baseFilename := random.String(32)
tmpDest := fmt.Sprintf("%s/%d%s.pdf", dirPath, i, baseFilename)
if err := unoconv(ctx, fpath, tmpDest, p.opts); err != nil {
return &standarderror.Error{Op: op, Err: err}
return handleErrContext(ctx, &standarderror.Error{Op: op, Err: err})
}
fpaths[i] = tmpDest
}