diff --git a/framework/writerhelper.go b/framework/writerhelper.go index 3656e01..00b2468 100644 --- a/framework/writerhelper.go +++ b/framework/writerhelper.go @@ -49,7 +49,7 @@ func (w *WriterHelper) WriteFile(outputFileName string) (err error) { if closeErr != nil { // If we also had an error on Close(), return both errors if writeErr != nil { - err = fmt.Errorf("%s; %w", err.Error(), writeErr) + err = fmt.Errorf("%s; %w", closeErr.Error(), writeErr) } else { err = closeErr }