Mocha patch for correct error code.