-
Notifications
You must be signed in to change notification settings - Fork 11
Adopt result-style error handling for factory functions instead of exceptions #89
Copy link
Copy link
Open
Description
Background
During PR review #80, @LinZhihao-723 suggested adopting result-style error handling (similar to Rust's Result type) instead of relying on exceptions, particularly for factory functions. The current approach of using factory functions that throw exceptions is not meaningful since constructors can behave similarly.
Benefits
Result-style error handling would allow:
- Forwarding error codes from the core FFI layer more effectively
- More explicit error handling patterns
- Better integration with the underlying CLP core error handling
Challenges
The main challenge identified is mapping such result types to Emscripten's Embind system for JavaScript bindings.
Timing
This enhancement should be implemented after:
- Syncing the latest CLP code into clp-ffi-js
- Completion of the proposed error handling refactoring in the CLP codebase
References
- Original discussion: feat: Add support for retrieving CLP IR stream-level metadata from IR stream readers (resolves #77). #80 (comment)
- PR: feat: Add support for retrieving CLP IR stream-level metadata from IR stream readers (resolves #77). #80
Requested by: @junhaoliao
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels