From 347c509308a1446193fb7872e19627f3df9e7eda Mon Sep 17 00:00:00 2001 From: Cristian Scheid Date: Tue, 3 Feb 2026 15:20:29 -0300 Subject: [PATCH] refactor(theming): use isAxiosError for error handling Signed-off-by: Cristian Scheid --- apps/theming/src/components/admin/FileInputField.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/theming/src/components/admin/FileInputField.vue b/apps/theming/src/components/admin/FileInputField.vue index 1af133d6991..0e60e89d100 100644 --- a/apps/theming/src/components/admin/FileInputField.vue +++ b/apps/theming/src/components/admin/FileInputField.vue @@ -7,7 +7,7 @@ import type { AdminThemingParameters } from '../../types.d.ts' import { mdiImageOutline, mdiUndo } from '@mdi/js' -import axios from '@nextcloud/axios' +import axios, { isAxiosError } from '@nextcloud/axios' import { showError } from '@nextcloud/dialogs' import { loadState } from '@nextcloud/initial-state' import { t } from '@nextcloud/l10n' @@ -76,8 +76,8 @@ async function onChange() { }) mime.value = file.type emit('updated') - } catch (error: any) { - if (error?.response?.status === 422) { + } catch (error) { + if (isAxiosError(error) && error.response?.status === 422) { const serverMessage = error.response.data?.data?.message showError(serverMessage || t('theming', 'Failed to upload image')) } else {