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
14 // Image errors
15 ErrImageNotFound = errors.New("image not found")
16 ErrImagePullFailed = errors.New("failed to pull image")
17 ErrInvalidImageFormat = errors.New("invalid image format")
18
19 // Route errors
20 ErrRouteNotFound = errors.New("route not found")
21 ErrRouteExists = errors.New("route already exists")
22 ErrInvalidRoute = errors.New("invalid route configuration")
23 ErrRouteDomainEmpty = errors.New("route domain cannot be empty")
24 ErrRouteImageEmpty = errors.New("route image cannot be empty")
25 ErrNoTargetAvailable = errors.New("no target available for route")
26
27 // Registry errors
28 ErrManifestNotFound = errors.New("manifest not found")
29 ErrBlobNotFound = errors.New("blob not found")
30 ErrUploadNotFound = errors.New("upload not found")
31 ErrInvalidDigest = errors.New("invalid digest")
32 ErrDigestMismatch = errors.New("digest mismatch")
33 ErrUnauthorized = errors.New("unauthorized")
34
35 // Network errors
36 ErrNetworkNotFound = errors.New("network not found")
37 ErrNetworkExists = errors.New("network already exists")
38
39 // Volume errors
40 ErrVolumeNotFound = errors.New("volume not found")
41 ErrVolumeExists = errors.New("volume already exists")
42
43 // Preview errors
44 ErrPreviewNotFound = errors.New("preview not found")
45
46 // Config errors
47 ErrConfigNotFound = errors.New("configuration not found")
48 ErrInvalidConfig = errors.New("invalid configuration")
49 ErrConfigLoadFailed = errors.New("failed to load configuration")
50 ErrInvalidDomainPattern = errors.New("invalid domain pattern")
51
52 // Environment errors
53 ErrEnvFileNotFound = errors.New("environment file not found")
54 ErrSecretNotFound = errors.New("secret not found")
55 ErrProviderNotFound = errors.New("secret provider not found")
56 ErrInvalidContainerName = errors.New("invalid container name")
57
58 // Authentication errors
59 ErrInvalidToken = errors.New("invalid token")
60 ErrExpiredToken = errors.New("token has expired")
61 ErrRevokedToken = errors.New("token has been revoked")
62 ErrInvalidCredentials = errors.New("invalid credentials")
63 ErrTokenNotFound = errors.New("token not found")
64
65 // Security errors
66 ErrPathTraversal = errors.New("path traversal not allowed")
67 ErrInvalidPath = errors.New("invalid path format")
68 ErrInsufficientScope = errors.New("insufficient scope for operation")
69 ErrInvalidScope = errors.New("invalid scope format")
70 ErrSSRFBlocked = errors.New("request to internal/blocked network not allowed")
71 ErrInvalidEnvKey = errors.New("invalid environment variable key")
72 ErrLongLivedToken = errors.New("long-lived tokens must be exchanged via /auth/token")
73
74 // Remote errors
75 ErrEmptyRemoteName = errors.New("remote name must not be empty")
76 ErrInvalidRemoteNameChar = errors.New("remote name contains invalid characters")
77 ErrConsecutiveDots = errors.New("remote name must not contain consecutive dots")
78 ErrPassUnavailable = errors.New("pass is not available")
79 ErrRemoteNotFound = errors.New("remote not found")
80
81 // Attachment errors
82 ErrAttachmentNotFound = errors.New("attachment not found")
83 ErrAttachmentExists = errors.New("attachment already exists")
84 ErrAttachmentImageEmpty = errors.New("attachment image cannot be empty")
85 ErrAttachmentTargetEmpty = errors.New("attachment target (domain or group) cannot be empty")
86 ErrAttachmentNotDeployed = errors.New("configured attachment is not deployed; run gordon deploy to create it")
87)