|
| 1 | +// Copyright (c) Microsoft Corporation. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +namespace Tes.RunnerCLI |
| 5 | +{ |
| 6 | + public enum ProcessExitCode |
| 7 | + { |
| 8 | + Success = 0, |
| 9 | + UncategorizedError = 10, |
| 10 | + IdentityUnavailable = 30, |
| 11 | + |
| 12 | + |
| 13 | + /* |
| 14 | + consider going down from 88 towards 78 (not inclusive) for "general" codes |
| 15 | +
|
| 16 | + -- section boundaries (based on nice even base-2 boundaries) -- |
| 17 | +
|
| 18 | + 88 |
| 19 | +
|
| 20 | + 96 |
| 21 | +
|
| 22 | + 112 |
| 23 | +
|
| 24 | + 120 |
| 25 | +
|
| 26 | + ---------- |
| 27 | + reserved (these can be used as appropriate, but only when there's no need to disambiguate) |
| 28 | + --- |
| 29 | + long-standing exit status convention for normal termination, i.e. not by signal: |
| 30 | +
|
| 31 | + Exit status 0: success |
| 32 | + Exit status 1: "failure", as defined by the program |
| 33 | + Exit status 2: command line usage error |
| 34 | +
|
| 35 | + there are common conventions when a program starts another: |
| 36 | +
|
| 37 | + 126 if the other program was found but could not be run |
| 38 | + 127 if the other program could not be found |
| 39 | + 128 plus the signal number if the process terminated abnormally (note: POSIX only specifies "greater than 128" and that kill -l exitstatus can be used to find the signal's short name) |
| 40 | +
|
| 41 | + Most binaries (especially shells) seem to use 1-63 based on disordered spot-checking of man pages |
| 42 | +
|
| 43 | + 64-78 sysexits (search for sysexits.h) |
| 44 | + 126-128 conventions for subprocess handling |
| 45 | + 129-255 exits due to "unhandled" signals |
| 46 | + numbers above 255 are not possible in Linux (and will be wrapped). |
| 47 | + */ |
| 48 | + |
| 49 | + // TODO Implement all process exit codes |
| 50 | + //AzureStorageNotResponding = 80, |
| 51 | + //AzureStorageNotAuthorizedManagedIdentityCredential = 81, |
| 52 | + //AzureStorageNotAuthorizedDefaultCredential = 82, |
| 53 | + //AzureStorageNotAuthorizedInvalidSASToken = 83, |
| 54 | + //AzureStorageNotAuthorizedSASTokenExpired = 84, |
| 55 | + //TerraAPINotResponding = 90, |
| 56 | + //TerraAPINotAuthorizedManagedIdentityCredential = 91, |
| 57 | + //TerraAPINotAuthorizedDefaultCredential = 92, |
| 58 | + //TerraAPIBadRequest = 93 |
| 59 | + } |
| 60 | +} |
0 commit comments