      * @return A rejected promise with `InvalidOrEmptyURL` error if `url` is `nil`, otherwise the promise from `then`.
      */
     private func checkForValidURL(url: NSURL?, then: (NSURL) -> Promise<WMFImageDownload>) -> Promise<WMFImageDownload> {
-        if url == nil { return Promise(WMFImageControllerErrorCode.InvalidOrEmptyURL.error) }
+        if url == nil { return Promise(error: WMFImageControllerErrorCode.InvalidOrEmptyURL.error) }
         else { return then(url!) }
     }
 

                   && err.code == WMFImageControllerErrorCode.DataNotFound.rawValue {
                    return Promise<UIImage?>(nil)
                } else {
                    return Promise(err)
                }
            })
    }


    /// Utility for creating a `Promise` cancelled with a WMFImageController error
    class func cancelledPromise<T>() -> Promise<T> {
        return Promise(error: WMFImageControllerErrorCode.FetchCancelled.error)
    }

    /// Utility for creating an `AnyPromise` cancelled with a WMFImageController error
