You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(watcher): add on_callback_error hook to WatchedField and AsyncWatchedField (#97)
Previously, on_change callback exceptions were silently swallowed and
only logged. Users had no way to opt into fail-loud behavior or custom
error handling.
Add on_callback_error: Callable[[Exception], None] | None = None to
_WatchedFieldBase.__init__, WatchedField.__init__, and
AsyncWatchedField.__init__. Thread the parameter through both
ConfigWatcher.field() and AsyncConfigWatcher.field() so it's accessible
at the call site. When set, the hook is called with the exception
instead of logging. If the hook re-raises, the watcher loop terminates.
Closes#61
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments