Replaced success, error with done() fail()

Resolves #1695

#1337oss