chore(observability): log 6 more silent failures across user/admin flows

Bare catch blocks in seller profile loader, newsletter signup, Hirn chat
session deletion, admin user save/delete, and IT-Hilfe status update
now logger.warn the bound error so failures are diagnosable in prod
instead of vanishing into UI-only error states.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
g-butandClaude Opus 4.7 committed 2026-04-26 15:09:30 +02:00
1 parent 4a1f2b9dfa
commit 7fecec5c08
5 files changed
+16 -6

No files matched your search

+3 -1
View File
@@ -15,6 +15,7 @@ import {
ShoppingBag,
} from 'lucide-react'
import { getConditionBadge } from '@/config/erfassung/conditions'
import { logger } from '@/lib/logger'
import { formatCHF } from '@/config/marketplace'
import { formatDateShort } from '@/lib/date-formats'
import Heading from '@/components/ui/Heading'
@@ -79,7 +80,8 @@ export default function SellerProfilePage({ params }: { params: Promise<{ id: st
} else {
setError(data.error || t('seller.sellerNotFound'))
}
} catch {
} catch (err) {
logger.warn('Failed to load seller profile', { error: err })
setError(t('seller.errorLoading'))
} finally {
setIsLoading(false)
+3 -1
View File
@@ -4,6 +4,7 @@ import { useState, useRef, useEffect } from 'react'
import { Send, Loader2, Bot, User, Sparkles, Trash2, Rocket, TriangleAlert } from 'lucide-react'
import Heading from '@/components/admin/AdminHeading'
import { apiFetch } from '@/lib/api/client'
import { logger } from '@/lib/logger'
interface HirnActionCard {
id: string
@@ -126,7 +127,8 @@ export function HirnChat({ sessionId, onSessionChange, compact = false }: HirnCh
})
setMessages([])
onSessionChange?.()
} catch {
} catch (err) {
logger.warn('Failed to delete Hirn chat session', { error: err })
setError('Fehler beim Löschen')
}
}
@@ -7,6 +7,7 @@
import { useState } from 'react'
import { apiFetch } from '@/lib/api/client'
import { logger } from '@/lib/logger'
import type { UserRow } from './types'
interface UseUserManagementReturn {
@@ -90,7 +91,8 @@ export function useUserManagement(): UseUserManagementReturn {
}
window.location.reload()
} catch {
} catch (err) {
logger.warn('Failed to update user', { error: err })
setError('Failed to update user')
} finally {
setIsSaving(false)
@@ -114,7 +116,8 @@ export function useUserManagement(): UseUserManagementReturn {
}
window.location.reload()
} catch {
} catch (err) {
logger.warn('Failed to delete user', { error: err })
setError('Failed to delete user')
} finally {
setIsDeleting(false)
@@ -3,6 +3,7 @@
import { useState } from 'react'
import { useTranslations } from 'next-intl'
import { apiFetch } from '@/lib/api/client'
import { logger } from '@/lib/logger'
interface NewsletterSignupProps {
title?: string
@@ -46,7 +47,8 @@ export function NewsletterSignup({
setErrorMsg(apiError)
setStatus('error')
}
} catch {
} catch (err) {
logger.warn('Newsletter signup failed', { error: err })
setErrorMsg(t('networkError'))
setStatus('error')
}
@@ -286,7 +286,8 @@ export function useITHilfeDetail(id: string) {
} else {
alert(result.error || t('errorUpdate'))
}
} catch {
} catch (err) {
logger.warn('Failed to update IT-Hilfe request status', { error: err, requestId: request.id, status })
alert(t('errorUpdate'))
}
}