|
root / src / exitcodes.reef
exitcodes.reef Reef 278 lines 6.7 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
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
/******************************************************************************
               __               ____                __
              / /   ___  ____ _/ __/_____________ _/ /__
             / /   / _ \/ __ `/ /_/ ___/ ___/ __ `/ / _ \
            / /___/  __/ /_/ / __(__  ) /__/ /_/ / /  __/
           /_____/\___/\__,_/_/ /____/\___/\__,_/_/\___/

   (C)opyright 2025, Leafscale, LLC -  https://www.leafscale.com

   Project: Zygaena
  Filename: exitcodes.reef
   Authors: Chris Tusa <chris.tusa@leafscale.com>
   License: <see LICENSE file included with this source code>
Description: Exit code constants for Coral package manager

******************************************************************************/

module exitcodes

export
    // Success
    fn EXIT_SUCCESS(): int

    // General errors (1-9)
    fn EXIT_ERROR(): int
    fn EXIT_USAGE(): int
    fn EXIT_CANCELLED(): int

    // Package errors (10-19)
    fn EXIT_PKG_NOT_FOUND(): int
    fn EXIT_PKG_ALREADY_INSTALLED(): int
    fn EXIT_PKG_INVALID(): int
    fn EXIT_PKG_CHECKSUM_MISMATCH(): int
    fn EXIT_PKG_SIGNATURE_INVALID(): int
    fn EXIT_PKG_CONFLICT(): int
    fn EXIT_INSTALL_FAILED(): int
    fn EXIT_REMOVE_FAILED(): int
    fn EXIT_UPGRADE_FAILED(): int

    // Build errors (20-29)
    fn EXIT_BUILD_FAILED(): int
    fn EXIT_PORT_NOT_FOUND(): int
    fn EXIT_SOURCE_MISSING(): int
    fn EXIT_PATCH_FAILED(): int
    fn EXIT_EXTRACT_FAILED(): int
    fn EXIT_CHECKSUM_FAILED(): int
    fn EXIT_PACKAGE_FAILED(): int

    // Network errors (30-39)
    fn EXIT_DOWNLOAD_FAILED(): int
    fn EXIT_REPO_UNREACHABLE(): int
    fn EXIT_TIMEOUT(): int

    // Database errors (40-49)
    fn EXIT_DB_ERROR(): int
    fn EXIT_DB_REGISTER_FAILED(): int
    fn EXIT_DB_CORRUPT(): int
    fn EXIT_DB_INDEX_STALE(): int

    // Permission errors (50-59)
    fn EXIT_PERMISSION_DENIED(): int
    fn EXIT_ROOT_REQUIRED(): int

    // Dependency errors (60-69)
    fn EXIT_DEPS_UNMET(): int
    fn EXIT_DEPS_CIRCULAR(): int
    fn EXIT_DEPS_CONFLICT(): int
    fn EXIT_DEPS_BLOCKED(): int

    // Config errors (70-79)
    fn EXIT_CONFIG_ERROR(): int
    fn EXIT_CONFIG_INVALID(): int
    fn EXIT_CONFIG_MISSING(): int

    // Informational codes for scripting (100+)
    fn EXIT_UPDATE_AVAILABLE(): int
    fn EXIT_MANIFEST_STALE(): int
    fn EXIT_NO_UPDATES(): int
end export

// ============================================================================
// Success (0)
// ============================================================================

fn EXIT_SUCCESS(): int
    return 0
end EXIT_SUCCESS

// ============================================================================
// General Errors (1-9)
// ============================================================================

fn EXIT_ERROR(): int
    return 1
end EXIT_ERROR

fn EXIT_USAGE(): int
    return 2
end EXIT_USAGE

fn EXIT_CANCELLED(): int
    return 3
end EXIT_CANCELLED

// ============================================================================
// Package Errors (10-19)
// ============================================================================

fn EXIT_PKG_NOT_FOUND(): int
    return 10
end EXIT_PKG_NOT_FOUND

fn EXIT_PKG_ALREADY_INSTALLED(): int
    return 11
end EXIT_PKG_ALREADY_INSTALLED

fn EXIT_PKG_INVALID(): int
    return 12
end EXIT_PKG_INVALID

fn EXIT_PKG_CHECKSUM_MISMATCH(): int
    return 13
end EXIT_PKG_CHECKSUM_MISMATCH

fn EXIT_PKG_SIGNATURE_INVALID(): int
    return 14
end EXIT_PKG_SIGNATURE_INVALID

fn EXIT_PKG_CONFLICT(): int
    return 15
end EXIT_PKG_CONFLICT

fn EXIT_INSTALL_FAILED(): int
    return 16
end EXIT_INSTALL_FAILED

fn EXIT_REMOVE_FAILED(): int
    return 17
end EXIT_REMOVE_FAILED

fn EXIT_UPGRADE_FAILED(): int
    return 18
end EXIT_UPGRADE_FAILED

// ============================================================================
// Build Errors (20-29)
// ============================================================================

fn EXIT_BUILD_FAILED(): int
    return 20
end EXIT_BUILD_FAILED

fn EXIT_PORT_NOT_FOUND(): int
    return 21
end EXIT_PORT_NOT_FOUND

fn EXIT_SOURCE_MISSING(): int
    return 22
end EXIT_SOURCE_MISSING

fn EXIT_PATCH_FAILED(): int
    return 23
end EXIT_PATCH_FAILED

fn EXIT_EXTRACT_FAILED(): int
    return 24
end EXIT_EXTRACT_FAILED

fn EXIT_CHECKSUM_FAILED(): int
    return 25
end EXIT_CHECKSUM_FAILED

fn EXIT_PACKAGE_FAILED(): int
    return 26
end EXIT_PACKAGE_FAILED

// ============================================================================
// Network Errors (30-39)
// ============================================================================

fn EXIT_DOWNLOAD_FAILED(): int
    return 30
end EXIT_DOWNLOAD_FAILED

fn EXIT_REPO_UNREACHABLE(): int
    return 31
end EXIT_REPO_UNREACHABLE

fn EXIT_TIMEOUT(): int
    return 32
end EXIT_TIMEOUT

// ============================================================================
// Database Errors (40-49)
// ============================================================================

fn EXIT_DB_ERROR(): int
    return 40
end EXIT_DB_ERROR

fn EXIT_DB_REGISTER_FAILED(): int
    return 41
end EXIT_DB_REGISTER_FAILED

fn EXIT_DB_CORRUPT(): int
    return 42
end EXIT_DB_CORRUPT

fn EXIT_DB_INDEX_STALE(): int
    return 43
end EXIT_DB_INDEX_STALE

// ============================================================================
// Permission Errors (50-59)
// ============================================================================

fn EXIT_PERMISSION_DENIED(): int
    return 50
end EXIT_PERMISSION_DENIED

fn EXIT_ROOT_REQUIRED(): int
    return 51
end EXIT_ROOT_REQUIRED

// ============================================================================
// Dependency Errors (60-69)
// ============================================================================

fn EXIT_DEPS_UNMET(): int
    return 60
end EXIT_DEPS_UNMET

fn EXIT_DEPS_CIRCULAR(): int
    return 61
end EXIT_DEPS_CIRCULAR

fn EXIT_DEPS_CONFLICT(): int
    return 62
end EXIT_DEPS_CONFLICT

fn EXIT_DEPS_BLOCKED(): int
    return 63
end EXIT_DEPS_BLOCKED

// ============================================================================
// Config Errors (70-79)
// ============================================================================

fn EXIT_CONFIG_ERROR(): int
    return 70
end EXIT_CONFIG_ERROR

fn EXIT_CONFIG_INVALID(): int
    return 71
end EXIT_CONFIG_INVALID

fn EXIT_CONFIG_MISSING(): int
    return 72
end EXIT_CONFIG_MISSING

// ============================================================================
// Informational Codes for Scripting (100+)
// ============================================================================

fn EXIT_UPDATE_AVAILABLE(): int
    return 100
end EXIT_UPDATE_AVAILABLE

fn EXIT_MANIFEST_STALE(): int
    return 101
end EXIT_MANIFEST_STALE

fn EXIT_NO_UPDATES(): int
    return 102
end EXIT_NO_UPDATES

end module