fix: update errorMessage to support lemmy errors again

This commit is contained in:
Xylight committed 2025-09-25 21:32:04 -07:00
1 parent 564b627560
commit f54e6242b3
1 file changed
+10
+10
View File
@@ -1,6 +1,16 @@
import { t } from "./i18n"
// eslint-disable-next-line
export function errorMessage(error: any, instance?: string): string {
try {
if (typeof error == 'string') {
try {
error = JSON.parse(error)
} catch {
/* try without catch would be cool imo */
}
}
if (error?.body?.message) {
error = JSON.parse(error?.body?.message).error
} else if (error?.message) {