Pass error code to cancel function (bug 1050544)
Merge pull request #119 from muffinresearch/fix-cancel-errcodes

Pass errorCode to cancel function (bug 1050544)