From 22df5d1c8f12cdc70832a2538caa4c059b736db3 Mon Sep 17 00:00:00 2001 From: Vladimir Meremyanin Date: Thu, 21 Feb 2013 12:16:08 +0400 Subject: [PATCH] document error callback behaviour --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c1b0429..4b7845c 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,9 @@ class Job after do ... end + error do |e| + ... + end transitions :from => :running, :to => :sleeping end end @@ -132,6 +135,8 @@ Also, you can pass parameters to events: In this case the `set_process` would be called with `:defagmentation` argument. +In case an error occurred during event it is `rescue`d and passed to `:error` callback, which can handle it or re`raise`. + ### Guards Let's assume you want to allow particular transitions only if a defined condition is