Skip to content

Commit cc5d32b

Browse files
committed
remove superfulous try/catch
1 parent 1f65611 commit cc5d32b

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

packages/data-context/src/actions/WizardActions.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,22 @@ export class WizardActions {
110110
debug('detectedLanguage %s', this.data.detectedLanguage)
111111
this.data.chosenLanguage = this.data.detectedLanguage || 'js'
112112

113-
try {
114-
const detected = detect(this.ctx.currentProject)
113+
const detected = detect(this.ctx.currentProject)
115114

116-
debug('detected %o', detected)
115+
debug('detected %o', detected)
117116

118-
if (detected) {
119-
this.ctx.update((coreData) => {
120-
coreData.wizard.detectedFramework = detected.framework ?? null
121-
coreData.wizard.chosenFramework = detected.framework ?? null
117+
if (detected) {
118+
this.ctx.update((coreData) => {
119+
coreData.wizard.detectedFramework = detected.framework ?? null
120+
coreData.wizard.chosenFramework = detected.framework ?? null
122121

123-
if (!detected.framework?.supportedBundlers[0]) {
124-
return
125-
}
122+
if (!detected.framework?.supportedBundlers[0]) {
123+
return
124+
}
126125

127-
coreData.wizard.detectedBundler = detected.bundler || detected.framework.supportedBundlers[0]
128-
coreData.wizard.chosenBundler = detected.bundler || detected.framework.supportedBundlers[0]
129-
})
130-
}
131-
} catch {
132-
// Could not detect anything - no problem, no need to do anything.
126+
coreData.wizard.detectedBundler = detected.bundler || detected.framework.supportedBundlers[0]
127+
coreData.wizard.chosenBundler = detected.bundler || detected.framework.supportedBundlers[0]
128+
})
133129
}
134130
}
135131

0 commit comments

Comments
 (0)