|
1 | 1 | <template> |
2 | 2 | <div class="sentry-page"> |
3 | 3 | <main class="sentry-page__main"> |
4 | | - <header class="sentry-page__main-header"> |
5 | | - <h1 class="sentry-page__main-exception">{{ exception }}</h1> |
| 4 | + <header class="sentry-page__main-header" v-if="hasException"> |
| 5 | + <h1 class="sentry-page__main-exception">{{ mainException.type }}</h1> |
6 | 6 |
|
| 7 | + <pre class="sentry-page__main-exception-message" v-html="mainException.value" /> |
| 8 | + <p class="sentry-page__main-date">{{ date }}</p> |
| 9 | + </header> |
| 10 | + |
| 11 | + <header class="sentry-page__main-header" v-if="hasMessage"> |
7 | 12 | <pre class="sentry-page__main-exception-message" v-html="message" /> |
8 | 13 | <p class="sentry-page__main-date">{{ date }}</p> |
9 | 14 | </header> |
10 | 15 |
|
11 | 16 | <SentryPageTags :event="event.payload" class="sentry-page__section" /> |
12 | 17 |
|
13 | | - <section class="sentry-page__section"> |
| 18 | + <section v-if="hasException" class="sentry-page__section"> |
14 | 19 | <h3 class="sentry-page__section-title">exceptions</h3> |
15 | 20 |
|
16 | 21 | <div class="sentry-page__section-exceptions"> |
@@ -60,14 +65,17 @@ export default defineComponent({ |
60 | 65 | }, |
61 | 66 | }, |
62 | 67 | computed: { |
63 | | - mainException() { |
64 | | - return this.event.payload.exception.values[0]; |
| 68 | + hasMessage(): boolean { |
| 69 | + return this.event.payload.message !== ""; |
| 70 | + }, |
| 71 | + message(): boolean { |
| 72 | + return this.event.payload.message; |
65 | 73 | }, |
66 | | - exception(): string { |
67 | | - return this.mainException.type; |
| 74 | + hasException(): boolean { |
| 75 | + return this.event.payload.exception?.values?.length > 0; |
68 | 76 | }, |
69 | | - message(): string { |
70 | | - return this.mainException.value; |
| 77 | + mainException() { |
| 78 | + return this.event.payload.exception.values[0]; |
71 | 79 | }, |
72 | 80 | date(): string { |
73 | 81 | return moment(this.event.payload.timestamp).toLocaleString(); |
|
0 commit comments