Skip to content

Commit 1257da9

Browse files
committed
chore: remove FetchProfileError
1 parent 7eba232 commit 1257da9

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

src/client/hooks/use-user.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import useSWR from "swr";
44

5-
import { FetchProfileError } from "../../errors";
65
import type { User } from "../../types";
76

87
export function useUser() {
@@ -11,7 +10,7 @@ export function useUser() {
1110
(...args) =>
1211
fetch(...args).then((res) => {
1312
if (!res.ok) {
14-
throw new FetchProfileError(res.status);
13+
throw new Error("Unauthorized");
1514
}
1615

1716
if (res.status === 204) {

src/errors/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,3 @@ export class AccessTokenForConnectionError extends SdkError {
144144
this.cause = cause;
145145
}
146146
}
147-
148-
export class FetchProfileError extends SdkError {
149-
public code: string = "fetch_profile_error";
150-
public status: number;
151-
152-
constructor(status: number) {
153-
super();
154-
this.name = "FetchProfileError";
155-
this.status = status;
156-
}
157-
}

0 commit comments

Comments
 (0)