Skip to content

Commit 2038c59

Browse files
committed
refactor: 사용자 프로필 정보를 가져오는 try-catch문 추가
1 parent dedbb05 commit 2038c59

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

app/(with-sidebar)/(home)/page.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,14 @@ const Page = () => {
8484
useEffect(() => {
8585
if (currentUser) {
8686
const loadData = async () => {
87-
const userProfile = await getProfile(currentUser.uid);
88-
setProfile(userProfile);
89-
90-
await loadTodos(currentUser.uid);
87+
try {
88+
const userProfile = await getProfile(currentUser.uid);
89+
setProfile(userProfile);
90+
await loadTodos(currentUser.uid);
91+
} catch (err) {
92+
console.error(err);
93+
setError('프로필 정보를 불러오는 데 실패하였습니다');
94+
}
9195
};
9296
loadData();
9397
} else {

0 commit comments

Comments
 (0)