benknoble / frosthaven-manager

GUI Frosthaven Scenario Manager
https://benknoble.github.io/frosthaven-manager
Other
5 stars 0 forks source link

Extract `define-error-text` macro #82

Closed benknoble closed 2 months ago

benknoble commented 4 months ago

It should take ids to bind to an @error-text observable and a with-error-text macro, backed by the obvious function implementation

(define (call-with-error-text @error-text th)
  (:= @error-text "")
  (with-handlers ([exn:fail? (lambda (e) (:= @error-text (exn-message e)))])
    (th))