Skip to content

Commit 01c4478

Browse files
author
Ahmed Elghareeb
committed
refactor: use promise.catch instead of try/catch
1 parent a9225ee commit 01c4478

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

web/frontend/src/index.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,10 @@ const AppContainer = () => {
261261
await setDefaultProxy();
262262
setContent(<App />);
263263
}
264-
try {
265-
fetchData();
266-
} catch (e: any) {
264+
fetchData().catch((e) => {
267265
setContent(<Failed>{e.toString()}</Failed>);
268266
console.log('error:', e);
269-
}
267+
});
270268
}, []);
271269

272270
return (

0 commit comments

Comments
 (0)