actors: Fix handling errors on resuming.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 24 Oct 2017 21:51:11 +0000 (16:51 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 24 Oct 2017 21:51:11 +0000 (16:51 -0500)
* 8sync/actors.scm (<-wait): Look at the correct action on the message
when checking for error when resuming.

8sync/actors.scm

index 8abe41a1133b20c65dcaf8a3ff3ca1c5f40a8c3e..b00329d32ab1fc489fae13ed46c9a3be258cdf4d 100644 (file)
            (big-random-number-string))
        #f))
 
            (big-random-number-string))
        #f))
 
-;; TODO: this should abort to the prompt, then check for errors
-;;   when resuming.
-
 (define (<-wait to action . args)
   (define prompt (*actor-prompt*))
   (when (not prompt)
     (error "Tried to <-wait without being in an actor's context..."))
 
   (let ((reply (abort-to-prompt prompt '<-wait to action args)))
 (define (<-wait to action . args)
   (define prompt (*actor-prompt*))
   (when (not prompt)
     (error "Tried to <-wait without being in an actor's context..."))
 
   (let ((reply (abort-to-prompt prompt '<-wait to action args)))
-    (cond ((eq? action '*error*)
+    (cond ((eq? (message-action reply) '*error*)
            (throw 'hive-unresumable-coroutine
                   "Won't resume coroutine; got an *error* as a reply"
                   #:message reply))
            (throw 'hive-unresumable-coroutine
                   "Won't resume coroutine; got an *error* as a reply"
                   #:message reply))