Error handling Rename

This commit is contained in:
PxlLoewe
2026-02-01 00:18:26 +01:00
parent a60cd67c44
commit 4ae2e93249
2 changed files with 27 additions and 26 deletions

View File

@@ -55,17 +55,14 @@ export const setStandardName = async ({
memberId: string;
userId: string;
}) => {
return discordAxiosClient
.post("/helper/set-standard-name", {
try {
await discordAxiosClient.post("/helper/set-standard-name", {
memberId,
userId,
})
.catch((error) => {
console.log("Error removing roles from member:", error);
return {
error:
((error as unknown as AxiosError).response?.data as unknown as { error: string }).error ||
(error as unknown as AxiosError).message,
};
});
} catch (error) {
return {
error: (error as AxiosError<{ error: string }>).response?.data.error || "Unknown error",
};
}
};