Skip to content

Commit

Permalink
refactor: remove unnecessary try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
sorccu committed Dec 19, 2024
1 parent 6984d6d commit b5fa3e1
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ export class JsonSourceFile<Schema> {
...options,
}

try {
const sourceFile = sourceFileLoader(filePath)
if (sourceFile === undefined) {
return
}

return JsonSourceFile.loadFromSourceFile(sourceFile)
} catch (err: any) {
const sourceFile = sourceFileLoader(filePath)
if (sourceFile === undefined) {
return
}

return JsonSourceFile.loadFromSourceFile(sourceFile)
}
}

0 comments on commit b5fa3e1

Please sign in to comment.