Skip to content

fix: thread error message handling #10742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/components/Thread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<AppContentDetails id="mail-message">
<!-- Show outer loading screen only if we have no data about the thread -->
<Loading v-if="loading && thread.length === 0" :hint="t('mail', 'Loading thread')" />
<Error v-else-if="error"
:error="error && error.message ? error.message : t('mail', 'Not found')"
<Error v-else-if="errorTitle || errorMessage"
:error="errorTitle ? errorTitle : t('mail', 'Not found')"
:message="errorMessage" />
<template v-else>
<div id="mail-thread-header">
Expand Down Expand Up @@ -96,7 +96,7 @@ export default {
loading: true,
message: undefined,
errorMessage: '',
error: undefined,
errorTitle: '',
expandedThreads: [],
participantsToDisplay: 999,
resizeDebounced: debounce(500, this.updateParticipantsToDisplay),
Expand Down Expand Up @@ -273,7 +273,7 @@ export default {
async resetThread() {
this.expandedThreads = [this.threadId]
this.errorMessage = ''
this.error = undefined
this.errorTitle = ''
await this.fetchThread()
this.updateParticipantsToDisplay()
this.updateSummary()
Expand All @@ -282,7 +282,7 @@ export default {
async fetchThread() {
this.loading = true
this.errorMessage = ''
this.error = undefined
this.errorTitle = ''
const threadId = this.threadId

try {
Expand All @@ -309,7 +309,7 @@ export default {
} catch (error) {
logger.error('could not load envelope thread', { threadId, error })
if (error?.response?.status === 403) {
this.error = t('mail', 'Could not load your message thread')
this.errorTitle = t('mail', 'Could not load your message thread')
this.errorMessage = t('mail', 'The thread doesn\'t exist or has been deleted')
this.loading = false
} else {
Expand Down
Loading