Skip to content

Commit

Permalink
feat(cli): optimize error
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 1, 2020
1 parent a1fdaca commit b510600
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/koishi-cli/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ let config: AppConfig | AppConfig[]
function tryCallback <T> (callback: () => T) {
try {
return callback()
} catch {}
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND' && error.code !== 'ENOENT') {
throw error
}
}
}

if (['.js', '.json', '.ts'].includes(extension)) {
Expand Down

0 comments on commit b510600

Please sign in to comment.