-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
44 lines (36 loc) · 1.54 KB
/
errors.go
File metadata and controls
44 lines (36 loc) · 1.54 KB
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
41
42
43
44
package seedling
import "github.com/mhiro2/seedling/internal/errx"
// Public error sentinels. Use errors.Is() to check.
var (
ErrBlueprintNotFound = errx.ErrBlueprintNotFound
ErrRelationNotFound = errx.ErrRelationNotFound
ErrFieldNotFound = errx.ErrFieldNotFound
ErrCycleDetected = errx.ErrCycleDetected
ErrTypeMismatch = errx.ErrTypeMismatch
// ErrInsertFailed reports that a blueprint Insert callback failed.
// Returned errors also unwrap to the original callback error.
ErrInsertFailed = errx.ErrInsertFailed
// ErrDeleteFailed reports that a blueprint Delete callback failed.
ErrDeleteFailed = errx.ErrDeleteFailed
// ErrDeleteNotDefined reports that a blueprint has no Delete function
// but Cleanup was called.
ErrDeleteNotDefined = errx.ErrDeleteNotDefined
ErrDuplicateBlueprint = errx.ErrDuplicateBlueprint
ErrInvalidOption = errx.ErrInvalidOption
)
// InsertFailedError wraps ErrInsertFailed with the blueprint name and the
// original insert callback error. Use errors.As to extract the blueprint name:
//
// var ife *seedling.InsertFailedError
// if errors.As(err, &ife) {
// log.Printf("blueprint %s failed", ife.Blueprint())
// }
type InsertFailedError = errx.InsertFailedError
// DeleteFailedError wraps ErrDeleteFailed with the blueprint name and the
// original delete callback error. Use errors.As to extract the blueprint name:
//
// var dfe *seedling.DeleteFailedError
// if errors.As(err, &dfe) {
// log.Printf("blueprint %s failed", dfe.Blueprint())
// }
type DeleteFailedError = errx.DeleteFailedError