Skip to content

Commit

Permalink
Remove error swallow
Browse files Browse the repository at this point in the history
  • Loading branch information
ProchaLu committed Nov 3, 2024
1 parent c625e1c commit 40d30a4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/(tabs)/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ export default function Profile() {

if (!response.ok) {
let errorMessage = 'Error logging out';
try {
const responseBody: LogoutResponseBodyGet = await response.json();
if ('error' in responseBody) {
errorMessage = responseBody.error;
}
} catch {}
const responseBody: LogoutResponseBodyGet = await response.json();
if ('error' in responseBody) {
errorMessage = responseBody.error;
}

Alert.alert('Error', errorMessage, [{ text: 'OK' }]);
return;
Expand Down

0 comments on commit 40d30a4

Please sign in to comment.