Skip to content

Add typed error propagation and initial test coverage#13

Open
MattBlack85 wants to merge 2 commits intomainfrom
claude/analyze-test-coverage-PlOfm
Open

Add typed error propagation and initial test coverage#13
MattBlack85 wants to merge 2 commits intomainfrom
claude/analyze-test-coverage-PlOfm

Conversation

@MattBlack85
Copy link
Copy Markdown
Collaborator

@MattBlack85 MattBlack85 commented Mar 19, 2026

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)

claude added 2 commits March 19, 2026 04:53
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants