Also support passing through state param for failure callback
Merge pull request #89 from smingins/master

Also support passing through state param for failure callback