also looking at this
fix(ios): report async pool exhaustion as busy
#267
19 files
+53
-65
| @@ -18,6 +18,8 @@ pub const BridgeError = error{ | ||
| 18 | 18 | InvalidJSON, |
| 19 | 19 | /// Invalid parameter value |
| 20 | 20 | InvalidParameter, |
| 21 | /// Native work is temporarily at capacity or an exclusive resource is in use | |
| 22 | Busy, | |
| 21 | 23 | /// Platform not supported for this operation |
| 22 | 24 | PlatformNotSupported, |
| 23 | 25 | /// Native API call failed |
| @@ -152,6 +154,7 @@ pub fn errorCodeString(err: BridgeError) []const u8 { | ||
| 152 | 154 | BridgeError.MissingData => "MISSING_DATA", |
| 153 | 155 | BridgeError.InvalidJSON => "INVALID_JSON", |
| 154 | 156 | BridgeError.InvalidParameter => "INVALID_PARAMETER", |
| 157 | BridgeError.Busy => "BUSY", | |
| 155 | 158 | BridgeError.PlatformNotSupported => "PLATFORM_NOT_SUPPORTED", |
| 156 | 159 | BridgeError.NativeCallFailed => "NATIVE_CALL_FAILED", |
| 157 | 160 | BridgeError.AllocationFailed => "ALLOCATION_FAILED", |
| @@ -174,6 +177,7 @@ pub fn errorMessage(err: BridgeError) []const u8 { | ||
| 174 | 177 | BridgeError.MissingData => "Required data is missing", |
| 175 | 178 | BridgeError.InvalidJSON => "Failed to parse JSON data", |
| 176 | 179 | BridgeError.InvalidParameter => "Invalid parameter value", |
| 180 | BridgeError.Busy => "Native operation is temporarily busy", | |
| 177 | 181 | BridgeError.PlatformNotSupported => "This operation is not supported on the current platform", |
| 178 | 182 | BridgeError.NativeCallFailed => "Native API call failed", |
| 179 | 183 | BridgeError.AllocationFailed => "Memory allocation failed", |
| @@ -351,6 +355,7 @@ test "errorCodeString returns correct codes" { | ||
| 351 | 355 | try testing.expectEqualStrings("WINDOW_HANDLE_NOT_SET", errorCodeString(BridgeError.WindowHandleNotSet)); |
| 352 | 356 | try testing.expectEqualStrings("UNKNOWN_ACTION", errorCodeString(BridgeError.UnknownAction)); |
| 353 | 357 | try testing.expectEqualStrings("MISSING_DATA", errorCodeString(BridgeError.MissingData)); |
| 358 | try testing.expectEqualStrings("BUSY", errorCodeString(BridgeError.Busy)); | |
| 354 | 359 | } |
| 355 | 360 | |
| 356 | 361 | test "ErrorContext.toJSON produces valid JSON" { |