Skip to content

Commit 16ce8ab

Browse files
committed
refac
1 parent 70a5be0 commit 16ce8ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/apis/users/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,16 @@ export const updateUserInfo = async (token: string, info: object) => {
284284

285285
export const getAndUpdateUserLocation = async (token: string) => {
286286
const location = await getUserPosition().catch((err) => {
287-
throw err;
287+
console.log(err);
288+
return null;
288289
});
289290

290291
if (location) {
291292
await updateUserInfo(token, { location: location });
292293
return location;
293294
} else {
294-
throw new Error('Failed to get user location');
295+
console.log('Failed to get user location');
296+
return null;
295297
}
296298
};
297299

0 commit comments

Comments
 (0)