Merge pull request #11 from Microsoft/download-error-checking

Add an error check to the update download function
This commit is contained in:
Will Anderson
2015-10-08 15:46:27 -07:00

View File

@@ -3,6 +3,10 @@ var extend = require("extend");
module.exports = (NativeCodePush) => {
var remote = {
download: function download() {
if (!this.downloadUrl) {
return Promise.reject(new Error("Cannot download an update without a download url"));
}
// Use the downloaded package info. Native code will save the package info
// so that the client knows what the current package version is.
return NativeCodePush.downloadUpdate(this)