-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy patherrors.go
More file actions
32 lines (25 loc) · 592 Bytes
/
errors.go
File metadata and controls
32 lines (25 loc) · 592 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package tarfs
import (
"errors"
"io/fs"
)
// Generic errors
var (
ErrNotDir = errors.New("not a directory")
ErrDir = errors.New("is a directory")
)
func newErrNotDir(op, path string) error {
return newErr(op, path, ErrNotDir)
}
func newErrDir(op, path string) error {
return newErr(op, path, ErrDir)
}
func newErrClosed(op, path string) error {
return newErr(op, path, fs.ErrClosed)
}
func newErrNotExist(op, path string) error {
return newErr(op, path, fs.ErrNotExist)
}
func newErr(op, path string, err error) error {
return &fs.PathError{Op: op, Path: path, Err: err}
}