-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
40 lines (32 loc) · 1.02 KB
/
errors.go
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
33
34
35
36
37
38
39
40
package ocfl
import (
"errors"
"fmt"
)
// MapDigestConflictErr indicates same digest found multiple times in the digest map
// (i.e., with different cases)
type MapDigestConflictErr struct {
Digest string
}
func (d *MapDigestConflictErr) Error() string {
return fmt.Sprintf("digest conflict for: '%s'", d.Digest)
}
// MapPathConflictErr indicates a path appears more than once in the digest map.
// It's also used in cases where the path as used as a directory in one instance
// and a file in another.
type MapPathConflictErr struct {
Path string
}
func (p *MapPathConflictErr) Error() string {
return fmt.Sprintf("path conflict for: '%s'", p.Path)
}
// MapPathInvalidErr indicates an invalid path in a Map.
type MapPathInvalidErr struct {
Path string
}
func (p *MapPathInvalidErr) Error() string {
return fmt.Sprintf("invalid path: '%s'", p.Path)
}
// ErrMapMakerExists is returned when calling Add with a path and digest that
// are already present in the MapMaker
var ErrMapMakerExists = errors.New("path and digest exist")