minor fixes

This commit is contained in:
2026-04-09 08:50:36 +02:00
parent 23d363a50c
commit a2457f4e49
75 changed files with 3848 additions and 387 deletions

View File

@@ -28,15 +28,21 @@ export function mapUploadErrorNotice(error, fallback = 'Upload failed.') {
const payload = error?.response?.data || {}
const reason = String(payload?.reason || '').toLowerCase()
const mapped = REASON_MAP[reason]
const errorCode = String(error?.code || '').toUpperCase()
const rawMessage = typeof error?.message === 'string' ? error.message.trim() : ''
const timedOut = errorCode === 'ECONNABORTED' || /timeout/i.test(rawMessage)
const requestTooLarge = status === 413
const type = mapped?.type
? mapped.type
: normalizeType(payload?.type || payload?.level, status >= 500 ? 'error' : 'warning')
: normalizeType(payload?.type || payload?.level, requestTooLarge ? 'warning' : (status >= 500 ? 'error' : 'warning'))
const message =
(requestTooLarge ? 'Server rejected this upload chunk as too large. Retrying with smaller chunks may help, or increase Nginx/PHP upload limits.' : '') ||
(timedOut ? 'Upload request timed out before the server responded. Check Nginx/PHP-FPM body handling and try again.' : '') ||
mapped?.message ||
(typeof payload?.message === 'string' && payload.message.trim()) ||
(typeof error?.message === 'string' && error.message.trim()) ||
rawMessage ||
fallback
return {