diff --git a/src/context/revoltjs/util.tsx b/src/context/revoltjs/util.tsx index 106fefe9..878cc50e 100644 --- a/src/context/revoltjs/util.tsx +++ b/src/context/revoltjs/util.tsx @@ -7,12 +7,12 @@ import { Children } from "../../types/Preact"; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function takeError(error: any): string { if (error.response) { - const status = error.response.status; - if (error.response.type) { - return error.response.type; + const type = error.response.data?.type; + if (type) { + return type; } - switch (status) { + switch (error.response.status) { case 429: return "TooManyRequests"; case 401: