mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-13 09:25:36 +08:00
Merge pull request #11 from Microsoft/download-error-checking
Add an error check to the update download function
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user