Pass errorCode to cancel function (bug 1050544)