{"action":"created","issue":{"url":"https://api.github.com/repos/aasm/aasm/issues/250","labels_url":"https://api.github.com/repos/aasm/aasm/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/aasm/aasm/issues/250/comments","events_url":"https://api.github.com/repos/aasm/aasm/issues/250/events","html_url":"https://github.com/aasm/aasm/issues/250","id":102756333,"number":250,"title":"How to return desired value after `error do`","user":{"login":"zenati","id":5849907,"avatar_url":"https://avatars.githubusercontent.com/u/5849907?v=3","gravatar_id":"","url":"https://api.github.com/users/zenati","html_url":"https://github.com/zenati","followers_url":"https://api.github.com/users/zenati/followers","following_url":"https://api.github.com/users/zenati/following{/other_user}","gists_url":"https://api.github.com/users/zenati/gists{/gist_id}","starred_url":"https://api.github.com/users/zenati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenati/subscriptions","organizations_url":"https://api.github.com/users/zenati/orgs","repos_url":"https://api.github.com/users/zenati/repos","events_url":"https://api.github.com/users/zenati/events{/privacy}","received_events_url":"https://api.github.com/users/zenati/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aasm/aasm/labels/callbacks","name":"callbacks","color":"bfdadc"},{"url":"https://api.github.com/repos/aasm/aasm/labels/feature%20request","name":"feature request","color":"009800"},{"url":"https://api.github.com/repos/aasm/aasm/labels/waiting%20for%20response","name":"waiting for response","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"alto","id":3209,"avatar_url":"https://avatars.githubusercontent.com/u/3209?v=3","gravatar_id":"","url":"https://api.github.com/users/alto","html_url":"https://github.com/alto","followers_url":"https://api.github.com/users/alto/followers","following_url":"https://api.github.com/users/alto/following{/other_user}","gists_url":"https://api.github.com/users/alto/gists{/gist_id}","starred_url":"https://api.github.com/users/alto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alto/subscriptions","organizations_url":"https://api.github.com/users/alto/orgs","repos_url":"https://api.github.com/users/alto/repos","events_url":"https://api.github.com/users/alto/events{/privacy}","received_events_url":"https://api.github.com/users/alto/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-08-24T10:04:49Z","updated_at":"2015-12-21T14:30:17Z","closed_at":null,"body":"```ruby\r\naasm whiny_transitions: false do\r\n  state :not_paid\r\n  state :paid\r\n\r\n  event :paid, guards: [:payable?] do\r\n    transitions from: :not_paid, to: :paid\r\n    \r\n    error do |exception|\r\n      # Logging exception\r\n      # how to return false here?\r\n    end\r\n  end\r\nend\r\n\r\ndef payable?\r\n  # API Calls...\r\n  false\r\nend\r\n```\r\n\r\nI'm using guards with error callback. What I need to acheive is\r\n- If guard returns false, than error callback is invoked and false is returned on `.paid?` call\r\n\r\nIs it possible?\r\n\r\nUsing the code above, the error cb is never called."},"comment":{"url":"https://api.github.com/repos/aasm/aasm/issues/comments/166317762","html_url":"https://github.com/aasm/aasm/issues/250#issuecomment-166317762","issue_url":"https://api.github.com/repos/aasm/aasm/issues/250","id":166317762,"user":{"login":"zenati","id":5849907,"avatar_url":"https://avatars.githubusercontent.com/u/5849907?v=3","gravatar_id":"","url":"https://api.github.com/users/zenati","html_url":"https://github.com/zenati","followers_url":"https://api.github.com/users/zenati/followers","following_url":"https://api.github.com/users/zenati/following{/other_user}","gists_url":"https://api.github.com/users/zenati/gists{/gist_id}","starred_url":"https://api.github.com/users/zenati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenati/subscriptions","organizations_url":"https://api.github.com/users/zenati/orgs","repos_url":"https://api.github.com/users/zenati/repos","events_url":"https://api.github.com/users/zenati/events{/privacy}","received_events_url":"https://api.github.com/users/zenati/received_events","type":"User","site_admin":false},"created_at":"2015-12-21T14:30:17Z","updated_at":"2015-12-21T14:30:17Z","body":"@alto :+1: "}}