preparing for v0.5

This commit is contained in:
default
2024-08-01 10:06:42 +08:00
parent 24778d1093
commit 93359110a2
115 changed files with 5153 additions and 4395 deletions

30
src/error/errors.go Normal file
View File

@@ -0,0 +1,30 @@
package error
var (
ErrAlreadyStarted = new("already started")
ErrNotStarted = new("not started")
ErrInvalid = new("invalid")
ErrUnsupported = new("unsupported")
ErrNotExists = new("does not exist")
ErrDuplicated = new("duplicated")
)
func Failure(what string) NestedError {
return errorf("%s failed", what)
}
func Invalid(subject, what any) NestedError {
return errorf("%w %s: %q", ErrInvalid, subject, what)
}
func Unsupported(subject, what any) NestedError {
return errorf("%w %s: %q", ErrUnsupported, subject, what)
}
func NotExists(subject, what any) NestedError {
return errorf("%s %w: %q", subject, ErrNotExists, what)
}
func Duplicated(subject, what any) NestedError {
return errorf("%w %s: %q", ErrDuplicated, subject, what)
}