Skip to content

Commit

Permalink
added more explanation about the error space
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Jul 17, 2024
1 parent fd325f9 commit 0f0595c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/LibNative/CommonRuntimeError.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
#include <aws/common/common.h>
#include <aws/common/error.h>

/**
* The file introduced the swift error spaces, defines the error code used for aws-crt-swift.
* We defined the error codes here because Swift error handling requires the use of enums, and Swift
* does not support extensible enums, which makes future extensions challenging. Therefore, we chose
* to add a C error space to ensure future-proofing.
*/

#define AWS_CRT_SWIFT_PACKAGE_ID 17

#define AWS_DEFINE_ERROR_INFO_CRT_SWIFT(CODE, STR) [(CODE)-0x4400] = AWS_DEFINE_ERROR_INFO(CODE, STR, "aws-crt-swift")
Expand Down

0 comments on commit 0f0595c

Please sign in to comment.