From b9684751ac1f23d8c7b5066952a486640718b080 Mon Sep 17 00:00:00 2001 From: melsener Date: Thu, 7 Mar 2024 15:29:45 +0300 Subject: [PATCH] chore: remove try catch --- .../containers/LoginContainer/LoginContainer.tsx | 10 +++++++--- .../ZeplinAuthEndContainer/ZeplinAuthEndContainer.tsx | 6 +----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/containers/LoginContainer/LoginContainer.tsx b/src/client/containers/LoginContainer/LoginContainer.tsx index 3211cb9..3d7e720 100644 --- a/src/client/containers/LoginContainer/LoginContainer.tsx +++ b/src/client/containers/LoginContainer/LoginContainer.tsx @@ -22,9 +22,13 @@ export const LoginContainer: FunctionComponent = () => { const { isInitializeLoading } = useInitialize(); const [login, { loginError }] = useLogin({ onSuccess: async (code?: string) => { - const { accessToken, refreshToken } = await requester.createAuthToken(String(code)); - storage.setAccessToken(accessToken); - storage.setRefreshToken(refreshToken); + try { + const { accessToken, refreshToken } = await requester.createAuthToken(String(code)); + storage.setAccessToken(accessToken); + storage.setRefreshToken(refreshToken); + } catch (err) { + // TODO: log to sentry + } replace(id ? url.getConfigurationUpdateUrl({ channel: channel as string, diff --git a/src/client/containers/ZeplinAuthEndContainer/ZeplinAuthEndContainer.tsx b/src/client/containers/ZeplinAuthEndContainer/ZeplinAuthEndContainer.tsx index 6b25609..cabbb0f 100644 --- a/src/client/containers/ZeplinAuthEndContainer/ZeplinAuthEndContainer.tsx +++ b/src/client/containers/ZeplinAuthEndContainer/ZeplinAuthEndContainer.tsx @@ -18,11 +18,7 @@ export const ZeplinAuthEndContainer: FunctionComponent = () => { return; } - try { - microsoftTeams.authentication.notifySuccess(code as string); - } catch (tokenError) { - microsoftTeams.authentication.notifyFailure((tokenError as Error)?.message ?? `Unknown error ${tokenError}`); - } + microsoftTeams.authentication.notifySuccess(code as string); }); }, []);