-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patherrors.go
More file actions
35 lines (28 loc) · 786 Bytes
/
errors.go
File metadata and controls
35 lines (28 loc) · 786 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
33
34
35
package gitdb
import "github.com/gogitdb/gitdb/v2/internal/errors"
var (
ErrNoRecords = errors.ErrNoRecords
ErrRecordNotFound = errors.ErrRecordNotFound
ErrInvalidRecordID = errors.ErrInvalidRecordID
ErrDBSyncFailed = errors.ErrDBSyncFailed
ErrLowBattery = errors.ErrLowBattery
ErrNoOnlineRemote = errors.ErrNoOnlineRemote
ErrAccessDenied = errors.ErrAccessDenied
ErrInvalidDataset = errors.ErrInvalidDataset
)
type ResolvableError interface {
Resolution() string
}
type Error struct {
err error
resolution string
}
func (e Error) Error() string {
return e.err.Error()
}
func (e Error) Resolution() string {
return e.resolution
}
func ErrorWithResolution(e error, resolution string) Error {
return Error{err: e, resolution: resolution}
}