Problem
The Rust core and Java bindings have tests for error conditions (invalid JSON, malformed flag configs, type mismatches), but Python and Go bindings have minimal or no error handling coverage.
Proper error handling at the WASM boundary is critical — the evaluator must never panic and should return structured error responses that bindings can surface to callers.
Current Coverage
| Error Scenario |
Rust |
Java |
Python |
Go |
| Invalid JSON input |
✅ |
✅ |
❌ |
❌ |
| Malformed flag config |
✅ |
✅ |
❌ |
❌ |
| Type mismatch (e.g., boolean flag evaluated as string) |
✅ |
✅ |
❌ |
❌ |
| Missing flag key |
✅ |
✅ |
❌ |
✅ |
| Empty/null context |
✅ |
✅ |
❌ |
partial |
Scope
For Python and Go bindings, add tests for:
- Invalid JSON — Passing malformed JSON to
update_state and evaluate
- Schema validation errors — Flag configs that fail JSON Schema validation
- Type mismatches — Evaluating a flag and expecting the wrong type
- Missing flags — Evaluating a flag key that doesn't exist
- Empty/null context — Evaluating with no context when targeting rules expect context
- Error response structure — Verify error responses include
error_code and error_message
Related
- Part of the test gap analysis from the cross-implementation review
Problem
The Rust core and Java bindings have tests for error conditions (invalid JSON, malformed flag configs, type mismatches), but Python and Go bindings have minimal or no error handling coverage.
Proper error handling at the WASM boundary is critical — the evaluator must never panic and should return structured error responses that bindings can surface to callers.
Current Coverage
Scope
For Python and Go bindings, add tests for:
update_stateandevaluateerror_codeanderror_messageRelated