Skip to content

Commit

Permalink
Raise exception if view is not implemented (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko authored Aug 23, 2024
1 parent 5ff93bc commit 978c6b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion owlkettle/widgetdef.nim
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ type

method build*(widget: Widget): WidgetState {.base.} = discard
method update*(widget: Widget, state: WidgetState): WidgetState {.base.} = discard
method view*(viewable: Viewable): Widget {.base.} = discard
method view*(viewable: Viewable): Widget {.base.} =
raise newException(Defect, "Unexpected call to `method view()`. Perhaps `method view(state: MyViewableState): Widget` for a `viewable MyViewable` is missing?")
method read*(state: WidgetState) {.base.} = discard
method assignApp*(widget: Widget, app: Viewable) {.base.} = discard

Expand Down

0 comments on commit 978c6b8

Please sign in to comment.