Skip to content

Commit a13209e

Browse files
committed
Add exception value to exception name in tree
1 parent a2b03d9 commit a13209e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

static/app/components/events/interfaces/frame/exceptionGroupContext.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled from '@emotion/styled';
33
import {Button} from 'sentry/components/button';
44
import {hasExceptionGroupTree} from 'sentry/components/events/interfaces/frame/utils';
55
import KeyValueList from 'sentry/components/events/interfaces/keyValueList';
6+
import {t} from 'sentry/locale';
67
import {space} from 'sentry/styles/space';
78
import {EntryType, Event, ExceptionValue, StackTraceMechanism} from 'sentry/types';
89
import {defined} from 'sentry/utils';
@@ -19,8 +20,16 @@ type ExceptionTreeProps = {
1920
parentException?: ExceptionValue;
2021
};
2122

23+
function getExceptionName(exception: ExceptionValue) {
24+
if (exception.type) {
25+
return exception.value ? `${exception.type}: ${exception.value}` : exception.type;
26+
}
27+
28+
return exception.value ?? t('Exception');
29+
}
30+
2231
function ExceptionLink({exception, link}: {exception: ExceptionValue; link: boolean}) {
23-
const exceptionName = exception.type || exception.value;
32+
const exceptionName = getExceptionName(exception);
2433

2534
if (!defined(exception.mechanism?.exception_id) || !link) {
2635
return <div>{exceptionName}</div>;
@@ -138,6 +147,7 @@ export function ExceptionGroupContext({
138147
}
139148

140149
const TreeChildLineSvg = styled('svg')`
150+
flex-shrink: 0;
141151
position: absolute;
142152
left: 6px;
143153
bottom: 50%;
@@ -154,6 +164,7 @@ const TreeItem = styled('div')<{level: number}>`
154164
`;
155165

156166
const Circle = styled('div')`
167+
flex-shrink: 0;
157168
border-radius: 50%;
158169
height: 12px;
159170
width: 12px;

0 commit comments

Comments
 (0)