summaryrefslogtreecommitdiff
path: root/file.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-12-07 00:26:53 +0800
committerxuri <xuri.me@gmail.com>2021-12-07 00:26:53 +0800
commit44a13aa402b0189b119635d2f0a26961795c6bda (patch)
tree0000ed94fe92507517281812ba49d85aa58a7211 /file.go
parent3325c3946d0ab77083555bab334381a1167ee580 (diff)
Export 7 errors so users can act differently on different type of errors
Diffstat (limited to 'file.go')
-rw-r--r--file.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/file.go b/file.go
index a430c5f..e2aeb4a 100644
--- a/file.go
+++ b/file.go
@@ -14,7 +14,6 @@ package excelize
import (
"archive/zip"
"bytes"
- "fmt"
"io"
"os"
"path/filepath"
@@ -58,7 +57,7 @@ func NewFile() *File {
// Save provides a function to override the spreadsheet with origin path.
func (f *File) Save() error {
if f.Path == "" {
- return fmt.Errorf("no path defined for file, consider File.WriteTo or File.Write")
+ return ErrSave
}
return f.SaveAs(f.Path)
}