X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=sam.git;a=blobdiff_plain;f=sam.scm;h=8f2741f3a61f7f268b8ed041d0919f0bf71e2315;hp=ed69987ff51aae1b0d8df6ac3f992f2c34c8ecc6;hb=7a4abf91e47b6115f8ad006b9b1a5653894a115e;hpb=bddae1c3d6107626a05f4a7b026905846c0227ac diff --git a/sam.scm b/sam.scm index ed69987..8f2741f 100644 --- a/sam.scm +++ b/sam.scm @@ -77,12 +77,15 @@ (let ((id (address-id address))) (let ((behaviour (hash-table-ref/default actor-table id '()))) (if (null? behaviour) - (print "Warning: discarded message " message + (print "## Warning: discarded message " message " to unknown actor id " id) - (match (apply (hash-table-ref actor-table id) (cons address message)) - ('done (hash-table-delete! actor-table id)) - ('sleep 'do-nothing) - (new-beh (hash-table-set! actor-table id new-beh))))))) + (condition-case + (match (apply behaviour (cons address message)) + ('done (hash-table-delete! actor-table id)) + ('sleep 'do-nothing) + (new-beh (hash-table-set! actor-table id new-beh))) + ((exn) + (print "## Warning: actor id " id " crashed evaluating message " message))))))) ;; Scheduler