refactor: improve error handling and utility functions in bucket management components

Signed-off-by: Noooste <83548733+Noooste@users.noreply.github.com>
This commit is contained in:
Noooste
2026-04-19 22:37:55 +02:00
parent c5324db1ad
commit fece799627
4 changed files with 19 additions and 41 deletions
+5 -2
View File
@@ -98,8 +98,11 @@ export const useAuthStore = create<AuthStore>()(
isLoading: false,
error: null
});
} catch (error: any) {
const errorMessage = error.response?.data?.error?.message || 'Login failed';
} catch (error) {
const errorMessage =
(error as { response?: { data?: { error?: { message?: string } } } })
.response?.data?.error?.message ||
(error instanceof Error ? error.message : 'Login failed');
set({
error: errorMessage,
isLoading: false,