Skip to content

Commit 5e9454b

Browse files
committed
different error message for profile not found
1 parent 766e195 commit 5e9454b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

client/src/app/profile/[userId]/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const profileFetcher = async (url: string): Promise<UserProfile> => {
2424
credentials: "include",
2525
})
2626

27+
if (response.status === 404) throw new Error("Profile not found")
2728
if (!response.ok) throw new Error("Failed to fetch data")
2829
const payload: unknown = await response.json()
2930
if (typeof payload !== "object" || Array.isArray(payload))

0 commit comments

Comments
 (0)