Skip to content

Commit 8d769ee

Browse files
don't throw unnecessary
1 parent 3a4a18c commit 8d769ee

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

packages/cursorless-engine/src/spokenForms/CustomSpokenForms.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,11 @@ export class CustomSpokenForms {
6060
constructor(private talonSpokenForms: TalonSpokenForms) {
6161
console.log("CustomSpokenForms constructor");
6262

63-
this.disposable = talonSpokenForms.onDidChange(() => {
64-
console.log("CustomSpokenForms.onDidChange");
65-
this.updateSpokenFormMaps().catch(() => {
66-
console.log("CustomSpokenForms.onDidChange() catch");
67-
});
68-
});
63+
this.disposable = talonSpokenForms.onDidChange(() =>
64+
this.updateSpokenFormMaps(),
65+
);
6966

70-
try {
71-
this.customSpokenFormsInitialized = this.updateSpokenFormMaps().catch(
72-
() => {
73-
console.log("CustomSpokenForms.updateSpokenFormMaps() catch");
74-
},
75-
);
76-
} catch (error) {
77-
console.log("CustomSpokenForms constructor catch");
78-
console.log(error);
79-
throw error;
80-
}
67+
this.customSpokenFormsInitialized = this.updateSpokenFormMaps();
8168

8269
console.log("CustomSpokenForms constructor done");
8370
}
@@ -117,9 +104,9 @@ export class CustomSpokenForms {
117104
this.spokenFormMap_ = { ...defaultSpokenFormMap };
118105
this.notifier.notifyListeners();
119106

120-
console.log("rethrowing err");
107+
console.log("return early");
121108

122-
throw err;
109+
return;
123110
}
124111

125112
for (const entryType of SUPPORTED_ENTRY_TYPES) {

0 commit comments

Comments
 (0)