Don't display unknown information

This commit is contained in:
Chocobozzz 2023-06-05 08:50:54 +02:00
parent 1ed1994fff
commit f5a12121fe
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 6 additions and 2 deletions

View File

@ -36,8 +36,12 @@ function buildMessage (name: string, err: Pick<HttpErrorResponse, 'message' | 's
}
if (err.status === HttpStatusCode.PAYLOAD_TOO_LARGE_413) {
const maxFileSize = err.headers?.get('X-File-Maximum-Size') || '8G'
return $localize`Your ${name} file was too large (max. size: ${maxFileSize})`
const maxFileSize = err.headers?.get('X-File-Maximum-Size')
let message = $localize`Your ${name} file was too large `
if (maxFileSize) message += $localize` (max. size: ${maxFileSize})`
return message
}
return err.message