Merge pull request #8069 from nextcloud/fix/noid/envelope-error

fix: handling of envelope fetch error messages
This commit is contained in:
Christoph Wurst 2023-02-22 11:33:06 +01:00 коммит произвёл GitHub
Родитель 4b342a7e87 d4a5e8e9c6
Коммит e1ec30ad85
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 33 добавлений и 8 удалений

Просмотреть файл

@ -2,6 +2,7 @@
- @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at>
-
- @author 2018 Christoph Wurst <christoph@winzerhof-wurst.at>
- @author 2023 Richard Steinmetz <richard@steinmetz.cloud>
-
- @license AGPL-3.0-or-later
-
@ -22,24 +23,32 @@
<template>
<NcEmptyContent
:title="error"
:description="message">
<p v-if="data && data.debug">
<a class="button"
:href="reportUrl"
target="_blank"
rel="noopener">{{ t('mail', 'Report this bug') }}</a>
</p>
:description="message"
class="mail-error"
:class="{ 'mail-error--auto-margin': autoMargin }">
<template #icon>
<AlertCircleIcon :size="24" />
</template>
<template v-if="data && data.debug" #action>
<NcButton :href="reportUrl">
{{ t('mail', 'Report this bug') }}
</NcButton>
</template>
</NcEmptyContent>
</template>
<script>
import { getReportUrl } from '../util/CrashReport'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent'
import NcButton from '@nextcloud/vue/dist/Components/NcButton'
import AlertCircleIcon from 'vue-material-design-icons/AlertCircle.vue'
export default {
name: 'Error',
components: {
NcEmptyContent,
NcButton,
AlertCircleIcon,
},
props: {
error: {
@ -54,6 +63,10 @@ export default {
type: Object,
default: () => undefined,
},
autoMargin: {
type: Boolean,
default: false,
},
},
computed: {
reportUrl() {
@ -62,3 +75,11 @@ export default {
},
}
</script>
<style lang="scss" scoped>
.mail-error {
&--auto-margin {
margin: auto 0;
}
}
</style>

Просмотреть файл

@ -167,9 +167,10 @@
:full-height="fullHeight"
@load="loading = LOADING_DONE" />
<Error v-else-if="error"
:error="error && error.message ? error.message : t('mail', 'Not found')"
:error="error.message || t('mail', 'Not found')"
message=""
:data="error"
:auto-margin="true"
role="alert" />
</div>
</template>
@ -416,6 +417,7 @@ export default {
methods: {
async fetchMessage() {
this.loading = LOADING_MESSAGE
this.error = undefined
logger.debug(`fetching thread message ${this.envelope.databaseId}`)
@ -437,6 +439,8 @@ export default {
this.loading = LOADING_DONE
}
} catch (error) {
this.error = error
this.loading = LOADING_DONE
logger.error('Could not fetch message', { error })
}