errors.go RawHistoryFolder
1package domain
2
3import "errors"
4
5// Domain errors represent business-level errors that can occur in the system.
6// These errors are used across layers to communicate specific failure conditions.
7var (
8 // Container errors
9 ErrContainerNotFound = errors.New("container not found")
10 ErrContainerExists = errors.New("container already exists")
11 ErrContainerNotRunning = errors.New("container is not running")
12 ErrContainerRunning = errors.New("container is already running")
13 ErrContainerExited = errors.New("container exited")
14
15 // Image errors
16 ErrImageNotFound = errors.New("image not found")
17 ErrImagePullFailed = errors.New("failed to pull image")
18 ErrInvalidImageFormat = errors.New("invalid image format")
19
20 // Route errors
21 ErrRouteNotFound = errors.New("route not found")
22 ErrRouteExists = errors.New("route already exists")
23 ErrInvalidRoute = errors.New("invalid route configuration")
24 ErrNoRouteForImage = errors.New("no route configured for image")
25 ErrRouteDomainEmpty = errors.New("route domain cannot be empty")
26 ErrRouteImageEmpty = errors.New("route image cannot be empty")
27 ErrRouteDomainInvalid = errors.New("route domain is not a valid public hostname")
28 ErrNoTargetAvailable = errors.New("no target available for route")
29
30 // Registry errors
31 ErrManifestNotFound = errors.New("manifest not found")
32 ErrBlobNotFound = errors.New("blob not found")
33 ErrUploadNotFound = errors.New("upload not found")
34 ErrInvalidDigest = errors.New("invalid digest")
35 ErrDigestMismatch = errors.New("digest mismatch")
36 ErrUnauthorized = errors.New("unauthorized")
37
38 // Network errors
39 ErrNetworkNotFound = errors.New("network not found")
40 ErrNetworkExists = errors.New("network already exists")
41
42 // Volume errors
43 ErrVolumeNotFound = errors.New("volume not found")
44 ErrVolumeExists = errors.New("volume already exists")
45
46 // Preview errors
47 ErrPreviewNotFound = errors.New("preview not found")
48
49 // Config errors
50 ErrConfigNotFound = errors.New("configuration not found")
51 ErrInvalidConfig = errors.New("invalid configuration")
52 ErrConfigLoadFailed = errors.New("failed to load configuration")
53 ErrInvalidDomainPattern = errors.New("invalid domain pattern")
54
55 // Environment errors
56 ErrEnvFileNotFound = errors.New("environment file not found")
57 ErrSecretNotFound = errors.New("secret not found")
58 ErrProviderNotFound = errors.New("secret provider not found")
59 ErrInvalidContainerName = errors.New("invalid container name")
60
61 // Authentication errors
62 ErrInvalidToken = errors.New("invalid token")
63 ErrExpiredToken = errors.New("token has expired")
64 ErrRevokedToken = errors.New("token has been revoked")
65 ErrInvalidCredentials = errors.New("invalid credentials")
66 ErrTokenNotFound = errors.New("token not found")
67
68 // Security errors
69 ErrPathTraversal = errors.New("path traversal not allowed")
70 ErrInvalidPath = errors.New("invalid path format")
71 ErrInsufficientScope = errors.New("insufficient scope for operation")
72 ErrInvalidScope = errors.New("invalid scope format")
73 ErrSSRFBlocked = errors.New("request to internal/blocked network not allowed")
74 ErrInvalidEnvKey = errors.New("invalid environment variable key")
75 ErrEnvContainsSecretRef = errors.New("environment file contains secret reference")
76 ErrLongLivedToken = errors.New("long-lived tokens must be exchanged via /auth/token")
77
78 // Remote errors
79 ErrEmptyRemoteName = errors.New("remote name must not be empty")
80 ErrInvalidRemoteNameChar = errors.New("remote name contains invalid characters")
81 ErrConsecutiveDots = errors.New("remote name must not contain consecutive dots")
82 ErrPassUnavailable = errors.New("pass is not available")
83 ErrRemoteNotFound = errors.New("remote not found")
84
85 // Attachment errors
86 ErrAttachmentNotFound = errors.New("attachment not found")
87 ErrAttachmentExists = errors.New("attachment already exists")
88 ErrAttachmentImageEmpty = errors.New("attachment image cannot be empty")
89 ErrAttachmentTargetEmpty = errors.New("attachment target (domain or group) cannot be empty")
90 ErrAttachmentNotDeployed = errors.New("configured attachment is not deployed; run gordon deploy to create it")
91)