mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
document error callback behaviour
This commit is contained in:
parent
24a4778ad4
commit
22df5d1c8f
1 changed files with 5 additions and 0 deletions
|
@ -88,6 +88,9 @@ class Job
|
||||||
after do
|
after do
|
||||||
...
|
...
|
||||||
end
|
end
|
||||||
|
error do |e|
|
||||||
|
...
|
||||||
|
end
|
||||||
transitions :from => :running, :to => :sleeping
|
transitions :from => :running, :to => :sleeping
|
||||||
end
|
end
|
||||||
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 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
|
### Guards
|
||||||
|
|
||||||
Let's assume you want to allow particular transitions only if a defined condition is
|
Let's assume you want to allow particular transitions only if a defined condition is
|
||||||
|
|
Loading…
Reference in a new issue