fix: avatar/logo display diagnostics and upload error handling
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m31s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m31s
Add error logging to silent catch blocks in avatar/logo URL generation, show user avatar on admin member detail page, and surface specific error messages for upload failures (CORS/network issues) instead of generic errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -142,16 +142,23 @@ export function LogoUpload({
|
||||
})
|
||||
|
||||
// Upload cropped blob directly to storage
|
||||
const uploadResponse = await fetch(uploadUrl, {
|
||||
method: 'PUT',
|
||||
body: croppedBlob,
|
||||
headers: {
|
||||
'Content-Type': 'image/png',
|
||||
},
|
||||
})
|
||||
let uploadResponse: Response
|
||||
try {
|
||||
uploadResponse = await fetch(uploadUrl, {
|
||||
method: 'PUT',
|
||||
body: croppedBlob,
|
||||
headers: {
|
||||
'Content-Type': 'image/png',
|
||||
},
|
||||
})
|
||||
} catch (fetchError) {
|
||||
console.error('Logo upload network error (possible CORS issue):', fetchError)
|
||||
throw new Error('Network error uploading file. The storage server may not be reachable.')
|
||||
}
|
||||
|
||||
if (!uploadResponse.ok) {
|
||||
throw new Error('Failed to upload file')
|
||||
console.error('Logo upload failed:', uploadResponse.status, uploadResponse.statusText)
|
||||
throw new Error(`Upload failed (${uploadResponse.status}). Please try again.`)
|
||||
}
|
||||
|
||||
// Confirm upload with the provider type that was used
|
||||
|
||||
Reference in New Issue
Block a user