add failure callback

--HG--
extra : rebase_source : 8d129c96098a71b8ec6dbae37348ac446d563588
add missed case.

--HG--
extra : rebase_source : df2522e174f55c7a4dcbe9a415e2090af4fdc21d
support for failure callbacks.