fix: use piefed post poll my_votes

This commit is contained in:
Xylight committed 2025-11-17 07:58:01 -08:00
1 parent dbe05459cd
commit 9945ef64cb
4 files changed
+21 -19

No files matched your search

+7 -3
View File
@@ -1,4 +1,4 @@
import { t } from "./i18n"
import { t } from './i18n'
// eslint-disable-next-line
export function errorMessage(error: any, instance?: string): string {
@@ -6,13 +6,17 @@ export function errorMessage(error: any, instance?: string): string {
if (typeof error == 'string') {
try {
error = JSON.parse(error)
} catch {
} catch {
/* try without catch would be cool imo */
}
}
if (error?.body?.message) {
error = JSON.parse(error?.body?.message).error
error = JSON.parse(error?.body?.message)
if (error?.message) {
// probably piefed weird error format
error = error.message
}
} else if (error?.message) {
error = error?.message
} else if (error?.error && typeof error?.error === 'string') {