Skip to content

Commit

Permalink
Merge pull request #9825 from nextcloud/feat/9814/log-AttachmentMissi…
Browse files Browse the repository at this point in the history
…ngError-as-warning

feat: Log AttachmentMissingError as a warning
  • Loading branch information
germelmann authored Jul 12, 2024
2 parents 6152885 + 092c924 commit b018ffe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/NewMessageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -414,26 +414,28 @@ export default {
await this.$store.dispatch('stopComposerSession')
this.$emit('close')
} catch (error) {
logger.error('could not send message', { error })
this.error = await matchError(error, {
[NoSentMailboxConfiguredError.getName()]() {
logger.error('could not send message', { error })
return t('mail', 'No sent mailbox configured. Please pick one in the account settings.')
},
[ManyRecipientsError.getName()]() {
logger.error('could not send message', { error })
return t('mail', 'You are trying to send to many recipients in To and/or Cc. Consider using Bcc to hide recipient addresses.')
},
// eslint-disable-next-line n/handle-callback-err
default(error) {
return undefined
logger.error('could not send message', { error })
},
})
this.warning = await matchError(error, {
[AttachmentMissingError.getName()]() {
logger.info('showing the did you forgot an attachment warning', { error })
return t('mail', 'You mentioned an attachment. Did you forget to add it?')
},
// eslint-disable-next-line n/handle-callback-err
default(error) {
return undefined
logger.warn('could not send message', { error })
},
})
} finally {
Expand Down

0 comments on commit b018ffe

Please sign in to comment.