Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,13 @@ public void dispatchDownloadProgressEvent() {
CodePushUtils.log(e);
mSettingsManager.saveFailedUpdate(CodePushUtils.convertReadableToJsonObject(updatePackage));
promise.reject(e);
} catch (IOException | CodePushUnknownException e) {
} catch (IOException | CodePushUnknownException | CodePushMalformedDataException e) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this is an overkill, given how slow and unrealiable our current E2E tests are, and that we are planning to add unit tests in the future.

CodePushUtils.log(e);
promise.reject(e);
} catch (Exception e) {
// Safety net: make sure a download failure always rejects the JS promise
// instead of escaping this background task uncaught, which would leave
// the promise hanging forever with no error and no log tying it to a cause.
CodePushUtils.log(e);
promise.reject(e);
}
Expand Down Expand Up @@ -492,6 +498,12 @@ protected Void doInBackground(Void... params) {
} catch(CodePushUnknownException e) {
CodePushUtils.log(e);
promise.reject(e);
} catch (Exception e) {
// Safety net: make sure a failure always rejects the JS promise
// instead of escaping this background task uncaught, which would leave
// the promise hanging forever with no error and no log tying it to a cause.
CodePushUtils.log(e);
promise.reject(e);
}

return null;
Expand Down Expand Up @@ -550,6 +562,12 @@ protected Void doInBackground(Void... params) {
} catch(CodePushUnknownException e) {
CodePushUtils.log(e);
promise.reject(e);
} catch (Exception e) {
// Safety net: make sure a failure always rejects the JS promise
// instead of escaping this background task uncaught, which would leave
// the promise hanging forever with no error and no log tying it to a cause.
CodePushUtils.log(e);
promise.reject(e);
}
return null;
}
Expand Down Expand Up @@ -634,7 +652,13 @@ public void onHostDestroy() {
}

promise.resolve("");
} catch(CodePushUnknownException e) {
} catch (CodePushUnknownException | CodePushMalformedDataException e) {
CodePushUtils.log(e);
promise.reject(e);
} catch (Exception e) {
// Safety net: make sure an install failure always rejects the JS promise
// instead of escaping this background task uncaught, which would leave
// the promise hanging forever with no error and no log tying it to a cause.
CodePushUtils.log(e);
promise.reject(e);
}
Expand Down