diff --git a/external/lang b/external/lang index fd152393..10c4f3be 160000 --- a/external/lang +++ b/external/lang @@ -1 +1 @@ -Subproject commit fd152393e48ccea8e5e6fdd6bd99fbc343c5b56d +Subproject commit 10c4f3be26e25ae4cc4bafc0811f4174236b5c3a diff --git a/src/context/revoltjs/util.tsx b/src/context/revoltjs/util.tsx index 625176f8..106fefe9 100644 --- a/src/context/revoltjs/util.tsx +++ b/src/context/revoltjs/util.tsx @@ -8,6 +8,10 @@ import { Children } from "../../types/Preact"; export function takeError(error: any): string { if (error.response) { const status = error.response.status; + if (error.response.type) { + return error.response.type; + } + switch (status) { case 429: return "TooManyRequests"; @@ -15,7 +19,7 @@ export function takeError(error: any): string { case 403: return "Unauthorized"; default: - return error.response.type ?? "UnknownError"; + return "UnknownError"; } } else if (error.request) { return "NetworkError";