Skip to content

fix: harden C API boundary exception handling (issue #34)#35

Open
willwade wants to merge 4 commits into
mainfrom
fix-capi-contributing
Open

fix: harden C API boundary exception handling (issue #34)#35
willwade wants to merge 4 commits into
mainfrom
fix-capi-contributing

Conversation

@willwade

Copy link
Copy Markdown

Issue #34

willwade added 4 commits June 26, 2026 10:44
- Add log_exception/log_error helpers for consistent exception handling
- Replace fprintf(stderr, ...) with log callback in all parameter accessors
- Add proper exception guards to setters that call broadcasting code
- Standardize all catches to use the log callback instead of silent swallows
- Update CONTRIBUTING.md Rule 4 with void function policy

Fixes:
- Setters (dasher_set_bool/long/string_parameter, dasher_set_speed_percent)
  now catch all exceptions and log via callback instead of propagating
- Getters now catch all exceptions (not just bad_variant_access) and use
  log callback instead of fprintf, ensuring diagnostics reach frontends
- dasher_set_screen_size Realize() failures now properly logged instead of
  silently discarded
- Updated Rule 4 to explicitly document void function behavior:
  log via callback and return, never propagate

Signed-off-by: will wade <willwade@gmail.com>
Signed-off-by: will wade <willwade@gmail.com>
…ion error

The log_exception and log_error functions need to access members of
dasher_ctx, so they must be defined after the struct is complete, not
just after its forward declaration.

Signed-off-by: will wade <willwade@gmail.com>
Signed-off-by: will wade <willwade@gmail.com>
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.

1 participant