fix: TypeScript type safety for error object properties

- Add proper type guards for error object properties
- Check for 'status' and 'data' properties before accessing
- Maintain all debugging functionality

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mistral Vibe
2026-03-30 19:56:41 +02:00
parent a62297f2c4
commit b66660ee30

View File

@@ -227,7 +227,7 @@ function SettingsForm({ me, onBack }: { me: MemberRead; onBack: () => void }) {
} else if (err.message.includes('422')) {
errorMessage = 'Invalid image file. Please upload a valid image (JPG, PNG, etc.).';
}
} else if (typeof err === 'object' && err !== null) {
} else if (typeof err === 'object' && err !== null && 'status' in err && 'data' in err) {
// Try to extract more details from the error object
console.error("Error details:", JSON.stringify(err));
if (err.status === 422 && err.data && err.data.detail) {