Skip to content

Commit

Permalink
improve index.ts Vert.x RPC service showTitle() usage to log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vorburger committed May 19, 2018
1 parent a36667b commit a7d8627
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scratch/src/index.ts
Expand Up @@ -53,7 +53,14 @@ let ScratchExtensions: any;
});

ext.sendTitle = function(sendTitle: string, callback: any) {
minecraft.showTitle(code, sendTitle, (err: any, result: any) => callback());
minecraft.showTitle(code, sendTitle, (err: any, result: any) => {
// TODO edewit: factor this out into a ../../api/src/api-utils.ts (?) usable from all functions here as well as scratch3/
if (err) {
console.log("sendTitle reply with error: ", err);
} else {
callback();
}
});
};
ext.narrate = function(entity, text, callack) {
eb.send("mcs.actions", { "action": "narrate", "entity": entity, "text": text, "code": code }, function(reply) {
Expand Down

0 comments on commit a7d8627

Please sign in to comment.