-
Notifications
You must be signed in to change notification settings - Fork 1
에러 타입 및 처리 방식 구조화 #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
에러 타입 및 처리 방식 구조화 #137
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
85b844e
feat: 에러 타입 정의 및 에러 처리 함수 생성
taew0o 5c262c0
feat: api 호출 시 error throw 및 handleError 적용
taew0o 64a85ad
feat: 로그인 페이지 세션 만료 확인 처리 로직 추가
taew0o 207e377
feat: 에러 처리 공통 컴포넌트 생성 및 페이지 적용
taew0o 7ffaf21
fix: useChatMessages return field에 isError 추가
taew0o 17a56d0
fix: login 페이지 useSearchParams 사용을 위한 server / client 페이지 구분
taew0o 468b5ac
Merge branch 'develop' into refactor/error
taew0o File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import NotFoundErrorPage from "@/shared/error/ui/404"; | ||
| export default function PostDetailNotFound() { | ||
| return <NotFoundErrorPage message="해당 게시글을 찾을 수 없습니다" />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| "use client"; | ||
| import ServerErrorPage from "@/shared/error/ui/500"; | ||
| export default function GlobalError({ error }: { error: Error }) { | ||
| return ( | ||
| <html> | ||
| <body> | ||
| <ServerErrorPage message={error.message} /> | ||
| </body> | ||
| </html> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,10 @@ | ||
| "use client"; | ||
|
|
||
| import React, { useEffect, useState } from "react"; | ||
| import { LoginForm } from "@/features/auth/ui/LoginForm/LoginForm"; | ||
| import { Modal } from "@/shared/ui/Modal/Modal"; | ||
| import { useRouter } from "next/navigation"; | ||
| import { useQueryClient } from "@tanstack/react-query"; | ||
| import { useAuthStore } from "@/features/auth/model/auth.store"; | ||
| import { useModalStore } from "@/shared/model/modal.store"; | ||
|
|
||
| export default function LoginPage() { | ||
| const router = useRouter(); | ||
| const queryClient = useQueryClient(); | ||
| const [errorMessage, setErrorMessage] = useState<string | null>(null); | ||
| const { setIsLogined } = useAuthStore(); | ||
| const { openModal, closeModal } = useModalStore(); | ||
|
|
||
| useEffect(() => { | ||
| queryClient.clear(); | ||
| }, []); | ||
| import { Suspense } from "react"; | ||
| import LoginPageClient from "@/widgets/main/ui/Client/LoginPage.client"; | ||
|
|
||
| export default function Page() { | ||
| return ( | ||
| <div className="flex min-h-[calc(100vh-70px)] flex-col items-center justify-center px-4 md:min-h-[calc(100vh-80px)] xl:min-h-[calc(100vh-100px)]"> | ||
| <h1 className="mb-8 text-2xl font-bold text-white">로그인</h1> | ||
| <LoginForm | ||
| size="lg" | ||
| onSuccess={() => { | ||
| openModal("normal", { | ||
| message: "로그인에 성공하였습니다.", | ||
| onClick: () => { | ||
| closeModal(); | ||
| setIsLogined(true); | ||
| router.push("/"); //메인 페이지 이동 | ||
| }, | ||
| }); | ||
| }} | ||
| onError={(msg) => { | ||
| setErrorMessage(msg); | ||
| }} | ||
| /> | ||
|
|
||
| {!!errorMessage && ( | ||
| <Modal | ||
| message={errorMessage} | ||
| buttonText="확인" | ||
| onClick={() => setErrorMessage(null)} | ||
| className="" | ||
| /> | ||
| )} | ||
| </div> | ||
| <Suspense fallback={"loading..."}> | ||
| <LoginPageClient /> | ||
| </Suspense> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import NotFoundErrorPage from "@/shared/error/ui/404"; | ||
|
|
||
| export default function GlobalNotFound() { | ||
| return <NotFoundErrorPage />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useChatMessages.ts가 반환하는 값의 타입에 isError가 없어서 빌드가 실패되는 것 같아요..!