-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
52 lines (44 loc) · 1.96 KB
/
errors.go
File metadata and controls
52 lines (44 loc) · 1.96 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
45
46
47
48
49
50
51
52
package forge
import (
"github.com/xraph/forge/errors"
)
// Re-export error constructors for backward compatibility.
var (
ErrServiceNotFound = errors.ErrServiceNotFound
ErrServiceAlreadyExists = errors.ErrServiceAlreadyExists
ErrCircularDependency = errors.ErrCircularDependency
ErrInvalidFactory = errors.ErrInvalidFactory
ErrTypeMismatch = errors.ErrTypeMismatch
ErrLifecycleTimeout = errors.ErrLifecycleTimeout
ErrContainerStarted = errors.ErrContainerStarted
ErrContainerStopped = errors.ErrContainerStopped
ErrScopeEnded = errors.ErrScopeEnded
)
// Extension-specific errors.
var (
ErrExtensionNotRegistered = errors.New("extension not registered with app")
)
// Re-export sentinel errors for error comparison using errors.Is().
var (
ErrServiceNotFoundSentinel = errors.ErrServiceNotFoundSentinel
ErrServiceAlreadyExistsSentinel = errors.ErrServiceAlreadyExistsSentinel
ErrCircularDependencySentinel = errors.ErrCircularDependencySentinel
ErrInvalidConfigSentinel = errors.ErrInvalidConfigSentinel
ErrValidationErrorSentinel = errors.ErrValidationErrorSentinel
ErrLifecycleErrorSentinel = errors.ErrLifecycleErrorSentinel
ErrContextCancelledSentinel = errors.ErrContextCancelledSentinel
ErrTimeoutErrorSentinel = errors.ErrTimeoutErrorSentinel
ErrConfigErrorSentinel = errors.ErrConfigErrorSentinel
)
// Scope identity errors.
var (
// ErrNoScope is returned when a Scope is required but not present in the context.
ErrNoScope = errors.Unauthorized("scope identity required")
// ErrNoOrg is returned when an organization-level Scope is required
// but the current Scope has no OrgID.
ErrNoOrg = errors.Forbidden("organization scope required")
)
// ServiceError represents a service-level error for backward compatibility.
type ServiceError = errors.ServiceError
// NewServiceError creates a new service error for backward compatibility.
var NewServiceError = errors.NewServiceError