Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 68ce5c2

Browse files
authored
Handle uncaught promise rejection (#1253)
1 parent 6733ac2 commit 68ce5c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

package-mixins.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AcquisitionManager as Sdk } from "code-push/script/acquisition-sdk";
22
import { NativeEventEmitter } from "react-native";
33
import RestartManager from "./RestartManager";
4+
import log from "./logging";
45

56
// This function is used to augment remote and local
67
// package objects with additional functionality/properties
@@ -30,7 +31,14 @@ module.exports = (NativeCodePush) => {
3031
Object.keys(updatePackageCopy).forEach((key) => (typeof updatePackageCopy[key] === 'function') && delete updatePackageCopy[key]);
3132

3233
const downloadedPackage = await NativeCodePush.downloadUpdate(updatePackageCopy, !!downloadProgressCallback);
33-
reportStatusDownload && reportStatusDownload(this);
34+
35+
if (reportStatusDownload) {
36+
reportStatusDownload(this)
37+
.catch((err) => {
38+
log(`Report download status failed: ${err}`);
39+
});
40+
}
41+
3442
return { ...downloadedPackage, ...local };
3543
} finally {
3644
downloadProgressSubscription && downloadProgressSubscription.remove();

0 commit comments

Comments
 (0)