Skip to content

Unknown parameter names and failing subscribers are logged and ignored #45

Open

Description

@trissim

Places at 1fcdf12 (src/objectstate/object_state.py) where an error is turned into a log line and the caller is told nothing:

  • update_parameter, lines 940-946: an unknown parameter name logs a warning and returns an empty set, the same result as "value unchanged". A misspelt path is indistinguishable from a no-op.
  • reset_parameter, lines 1856-1857: an unknown name returns silently.
  • _notify_state_changed, lines 600-606: an exception in a subscriber is logged as a warning and dropped.
  • _notify_resolved_changed, lines 637-661: the same, and RuntimeError is reported as a "dead callback".

A view that fails while repainting from a change therefore keeps showing the old value and nothing fails.

Wanted: unknown names raise KeyError (as type_for_path and signature_default already do); subscriber exceptions propagate to the caller of the mutation, after every subscriber has been called if that ordering matters.

Acceptance: state.update_parameter("no_such_field", 1) raises; a subscriber that raises makes update_parameter raise the same exception.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions