Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWS: Async rewrite #8888

Open
wants to merge 26 commits into
base: multi-wiki-support
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
tmp/
output/
node_modules/
store/
/editions/*/store
/test-results/
/playwright-report/
/playwright/.cache/
Expand Down
38 changes: 28 additions & 10 deletions boot/boot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions core/modules/commander.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,25 +109,31 @@ Commander.prototype.executeNextCommand = function() {
}
}
if(command.info.synchronous) {
// Synchronous command
// Synchronous command (or returns a promise)
c = new command.Command(params,this);
err = c.execute();
if(err) {
if(err instanceof Promise){
err.catch(function(e){return e;}).then(function(err) {
if(err) self.callback(err);
else self.executeNextCommand();
});
} else if(err) {
this.callback(err);
} else {
this.executeNextCommand();
}
} else {
// Asynchronous command
// Asynchronous command requires a callback (but we still catch returned errors either way)
c = new command.Command(params,this,function(err) {
if(err) {
self.callback(err);
} else {
self.executeNextCommand();
}
if(err) self.callback(err);
else self.executeNextCommand();
});
err = c.execute();
if(err) {
if(err instanceof Promise){
err.catch(function(e){return e;}).then(function(err) {
if(err) self.callback(err);
});
} else if(err) {
this.callback(err);
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/modules/startup/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports.startup = function(callback) {
$tw.boot.argv,
function(err) {
if(err) {
return $tw.utils.error("Error: " + err);
return $tw.utils.error("Error: " + (err.stack || err.message || err));
}
callback();
},
Expand Down
Loading
Loading