Skip to content

Commit 5fd9dd9

Browse files
committed
🧑‍💻 Reserve operating system status codes #103
1 parent 933ba5f commit 5fd9dd9

File tree

3 files changed

+63
-46
lines changed

3 files changed

+63
-46
lines changed

sdk-docs/Xecrets.Sdk.XfSdkVersion.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.O
1717
## XfSdkVersion.SdkVersion Property
1818

1919
The API version is to be updated when the command line options are updated in an incompatible way. The minor
20-
version is increased if changes do not change the meaning or syntax of any pre-existing options, i.e. purely
21-
new additional capabilities. The major version is increased if changes in any way changes an existing option
22-
so it may not work as expected by an older consumer. The consumer should thus only accept an export version
23-
that has the same Major version, and a minor version greather than or equal to it's known version.
20+
version is increased if changes do not change the meaning or syntax of any pre-existing options, i.e. purely new
21+
additional capabilities. The major version is increased if changes in any way changes an existing option so it
22+
may not work as expected by an older consumer. The consumer should thus only accept an export version that has
23+
the same Major version, and a minor version greather than or equal to it's known version.
2424

2525
```csharp
2626
public static System.Version SdkVersion { get; }
@@ -30,7 +30,8 @@ public static System.Version SdkVersion { get; }
3030
[System.Version](https://docs.microsoft.com/en-us/dotnet/api/System.Version 'System.Version')
3131
3232
### Remarks
33-
Changes includes not only syntax and semantics, but also actual numerical values assigned to <seealso cref="T:Xecrets.Sdk.Cli.XfOpCode"/> and <seealso cref="T:Xecrets.Sdk.Cli.XfCliApi"/> as well as changes or removals of json property names in
33+
Changes includes not only syntax and semantics, but also actual numerical values assigned to <seealso cref="T:Xecrets.Sdk.Cli.XfOpCode"/>, <seealso cref="T:Xecrets.Sdk.Cli.XfStatusCode"> and </seealso>and <seealso cref="T:Xecrets.Sdk.Cli.XfCliApi"/> as well as changes
34+
or removals of json property names in
3435
<seealso cref="T:Xecrets.Sdk.Cli.CliMessage"/> .
3536
### Methods
3637

src/Xecrets.Cli/Public/XfExportVersion.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public static class XfExportVersion
4949
/// 4.0 -> 2024-12-16 Add --work-folder and change meaning of --cli-crash-log
5050
/// 4.1 -> 2024-12-19 Add --crash
5151
/// 5.0 -> 2024-12-28 Rename some options to clarify syntax, i.e. encrypt-to -> encrypt-from-to etc.
52+
/// 6.0 -> 2025-01-16 Add operating system status return codes
5253
/// </remarks>
53-
public static Version CliVersion => new(5, 0);
54+
public static Version CliVersion => new(6, 0);
5455
}

src/Xecrets.Cli/Public/XfStatusCode.cs

Lines changed: 55 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,44 +38,59 @@ public enum XfStatusCode
3838
{
3939
Success = 0,
4040

41-
AxCryptException = 3,
42-
BadSequence = 6,
43-
Canceled = 9,
44-
CannotDelete = 12,
45-
CannotRead = 15,
46-
CannotWrite = 18,
47-
CliToolIncompatible = 21,
48-
CliToolNotFound = 24,
49-
DebugBreakFailed = 27,
50-
DeserializeError = 30,
51-
Error = 33,
52-
ExceptionError = 36,
53-
ExtraArguments = 39,
54-
FileUnavailable = 42,
55-
InternalError = 45,
56-
InternalUnexpectedAction = 48,
57-
InternalUnknownStatus = 51,
58-
InvalidDays = 54,
59-
InvalidEmail = 57,
60-
InvalidLicenseFormat = 60,
61-
InvalidLicenseSignature = 63,
62-
InvalidOption = 66,
63-
InvalidPassword = 69,
64-
InvalidToken = 72,
65-
LockedInUse = 75,
66-
MissingArgument = 78,
67-
NoDryRun = 81,
68-
NoPassword = 84,
69-
NotAFile = 87,
70-
NotAFolder = 90,
71-
NotSupported = 93,
72-
NotWritable = 96,
73-
NotYetImplemented = 99,
74-
PublicKeyNotFound = 102,
75-
Slip39Error = 105,
76-
UnhandledOperationException = 108,
77-
UnhandledRunException = 111,
78-
UnknownEnvironmentVariable = 114,
79-
UnknownOption = 117,
80-
Unlicensed = 120,
41+
OsFileNotFound = 2, // 0x02
42+
OsPathNotFound = 3, // 0x03
43+
OsTooManyOpenFiles = 4, // 0x04
44+
OsAccessDenied = 5, // 0x05
45+
OsNotEnoughMemory = 8, // 0x08
46+
OsBadFormat = 11, // 0x0b
47+
OsInvalidData = 13, // 0x0d
48+
OsOutOfMemory = 14, // 0x0e
49+
OsNetOutOfMemory = 23, // 0x17
50+
OsIllegalInstruction = 29, // 0x1d
51+
OsSharingViolation = 32, // 0x20
52+
OsLockViolation = 33, // 0x21
53+
OsBadImageFormat = 123, // 0x7b
54+
OsStackOverflow = 253, // 0xfd
55+
56+
AxCryptException = 6,
57+
BadSequence = 9,
58+
Canceled = 12,
59+
CannotDelete = 15,
60+
CannotRead = 18,
61+
CannotWrite = 21,
62+
CliToolIncompatible = 24,
63+
CliToolNotFound = 27,
64+
DebugBreakFailed = 30,
65+
DeserializeError = 36,
66+
Error = 39,
67+
ExceptionError = 42,
68+
ExtraArguments = 45,
69+
FileUnavailable = 48,
70+
InternalError = 51,
71+
InternalUnexpectedAction = 54,
72+
InternalUnknownStatus = 57,
73+
InvalidDays = 60,
74+
InvalidEmail = 63,
75+
InvalidLicenseFormat = 66,
76+
InvalidLicenseSignature = 69,
77+
InvalidOption = 72,
78+
InvalidPassword = 75,
79+
InvalidToken = 78,
80+
LockedInUse = 81,
81+
MissingArgument = 84,
82+
NoDryRun = 87,
83+
NoPassword = 90,
84+
NotAFile = 93,
85+
NotAFolder = 96,
86+
NotSupported = 99,
87+
NotWritable = 102,
88+
NotYetImplemented = 105,
89+
PublicKeyNotFound = 108,
90+
Slip39Error = 111,
91+
UnhandledOperationException = 114,
92+
UnhandledRunException = 117,
93+
UnknownEnvironmentVariable = 120,
94+
UnknownOption = 126,
95+
Unlicensed = 127,
8196
}

0 commit comments

Comments
 (0)