Skip to content

Commit

Permalink
fix(MediaHandler): Show proper error message on upload failure
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Aug 28, 2024
1 parent 2c9273e commit 84de239
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Editor/MediaHandler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ export default {
return Promise.all(uploadPromises)
.catch(error => {
logger.error('Uploading multiple images failed', { error })
showError(error?.response?.data?.error || error.message)
logger.error('Uploading multiple attachments failed', { error })
showError(t('text', 'Uploading multiple attachments failed.'))
})
.then(() => {
this.state.isUploadingAttachments = false
Expand All @@ -145,8 +145,8 @@ export default {
)
})
.catch((error) => {
logger.error('Uploading image failed', { error })
showError(error?.response?.data?.error)
logger.error('Uploading attachment failed', { error })
showError(t('text', 'Uploading attachment failed.'))
})
.then(() => {
this.state.isUploadingAttachments = false
Expand All @@ -173,8 +173,8 @@ export default {
null, response.data?.dirname,
)
}).catch((error) => {
logger.error('Failed to insert image path', { error })
showError(error?.response?.data?.error || error.message)
logger.error('Failed to insert from Files', { error })
showError(t('text', 'Failed to insert from Files'))
}).then(() => {
this.state.isUploadingAttachments = false
})
Expand Down

0 comments on commit 84de239

Please sign in to comment.