From 16ce8ab16c05c76b58477b86b93a99418d3b51a2 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 17 Feb 2025 17:41:58 -0800 Subject: [PATCH] refac --- src/lib/apis/users/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/apis/users/index.ts b/src/lib/apis/users/index.ts index b0efe39d2..f479b130c 100644 --- a/src/lib/apis/users/index.ts +++ b/src/lib/apis/users/index.ts @@ -284,14 +284,16 @@ export const updateUserInfo = async (token: string, info: object) => { export const getAndUpdateUserLocation = async (token: string) => { const location = await getUserPosition().catch((err) => { - throw err; + console.log(err); + return null; }); if (location) { await updateUserInfo(token, { location: location }); return location; } else { - throw new Error('Failed to get user location'); + console.log('Failed to get user location'); + return null; } };