Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Added error checks to the auto update mechanism. So in case the auto …
Browse files Browse the repository at this point in the history
…update mechansim fails, we will now give chance to the default update process Handler to handle the update mechanism (Which is essentially taking the user to brackets.io). (#14605)
  • Loading branch information
nethip committed Dec 3, 2018
1 parent cca4422 commit fc2ebbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/extensions/default/AutoUpdate/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,12 @@ define(function (require, exports, module) {

} else {
// Update not present for current platform
return;
return false;
}

if (!checksum || !downloadURL || !installerName) {
console.warn("AutoUpdate : asset information incorrect for the update");
return;
return false;
}

var updateParams = {
Expand Down
7 changes: 6 additions & 1 deletion src/utils/UpdateNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,12 @@ define(function (require, exports, module) {
*/
function handleUpdateProcess(updates) {
var handler = _updateProcessHandler || _defaultUpdateProcessHandler;
handler(updates);
var success = handler(updates);
if (_updateProcessHandler && !success) {
// Give a chance to default handler in case
// the auot update mechanism has failed.
_defaultUpdateProcessHandler(updates);
}
}

/**
Expand Down

0 comments on commit fc2ebbe

Please sign in to comment.