Add typed error propagation and initial test coverage#13
Open
MattBlack85 wants to merge 2 commits intomainfrom
Open
Add typed error propagation and initial test coverage#13MattBlack85 wants to merge 2 commits intomainfrom
MattBlack85 wants to merge 2 commits intomainfrom
Conversation
Introduce AsiCameraError and AsiEfwError enums (via thiserror) so that SDK error codes are now propagated as Result<T, E> instead of being silently logged and discarded. All libasi wrapper functions have been updated to return Result, and callers in the CCD and EFW daemons handle errors appropriately (propagate in constructors, log-and-continue in polling/runtime paths). Also adds 22 unit tests across three modules: - libasi/src/camera.rs: all 19 ASI error code mappings - libasi/src/efw.rs: all 10 EFW error code mappings including the EFW_ERROR_MOVING sentinel used by check_wheel_is_moving() - src/lib.rs: string utility edge cases (null terminators, invalid UTF-8, empty arrays) and a new parse_device_topic() utility covering the previously inline and untested MQTT topic parsing logic - src/bin/efw/efw.rs: JSON serialization shape (verifies #[serde(skip)] fields do not leak into published state) https://claude.ai/code/session_01Pa1qQU4xGtZxgBfZQS4eDL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce AsiCameraError and AsiEfwError enums (via thiserror) so that
SDK error codes are now propagated as Result<T, E> instead of being
silently logged and discarded. All libasi wrapper functions have been
updated to return Result, and callers in the CCD and EFW daemons handle
errors appropriately (propagate in constructors, log-and-continue in
polling/runtime paths).
Also adds 22 unit tests across three modules:
EFW_ERROR_MOVING sentinel used by check_wheel_is_moving()
empty arrays) and a new parse_device_topic() utility covering the
previously inline and untested MQTT topic parsing logic
fields do not leak into published state)