Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
import * as React from 'react';
import styled from '@emotion/styled';

import ExceptionMechanism from 'app/components/events/interfaces/exceptionMechanism';
import Annotated from 'app/components/events/meta/annotated';
import space from 'app/styles/space';
import {ExceptionType} from 'app/types';
import {Event} from 'app/types/event';
import {STACK_TYPE} from 'app/types/stacktrace';

import ExceptionStacktraceContent from './exceptionStacktraceContent';
import ExceptionTitle from './exceptionTitle';
import Mechanism from './mechanism';
import StackTrace from './stackTrace';
import ExceptionTitle from './title';

type ExceptionStacktraceContentProps = React.ComponentProps<
typeof ExceptionStacktraceContent
>;
type StackTraceProps = React.ComponentProps<typeof StackTrace>;

type Props = {
event: Event;
type: STACK_TYPE;
platform: ExceptionStacktraceContentProps['platform'];
stackView?: ExceptionStacktraceContentProps['stackView'];
platform: StackTraceProps['platform'];
stackView?: StackTraceProps['stackView'];
newestFirst?: boolean;
} & Pick<ExceptionType, 'values'> &
Pick<
React.ComponentProps<typeof ExceptionStacktraceContent>,
React.ComponentProps<typeof StackTrace>,
'groupingCurrentLevel' | 'hasHierarchicalGrouping'
>;

const ExceptionContent = ({
const Content = ({
newestFirst,
event,
stackView,
Expand All @@ -47,8 +45,8 @@ const ExceptionContent = ({
<Annotated object={exc} objectKey="value" required>
{value => <StyledPre className="exc-message">{value}</StyledPre>}
</Annotated>
{exc.mechanism && <ExceptionMechanism data={exc.mechanism} />}
<ExceptionStacktraceContent
{exc.mechanism && <Mechanism data={exc.mechanism} />}
<StackTrace
data={
type === STACK_TYPE.ORIGINAL
? exc.stacktrace
Expand All @@ -74,7 +72,7 @@ const ExceptionContent = ({
return <div>{children}</div>;
};

export default ExceptionContent;
export default Content;

const StyledPre = styled('pre')`
margin-bottom: ${space(1)};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import ErrorBoundary from 'app/components/errorBoundary';
import ExceptionContent from 'app/components/events/interfaces/exceptionContent';
import RawExceptionContent from 'app/components/events/interfaces/rawExceptionContent';
import {ExceptionType, Group, PlatformType, Project} from 'app/types';
import {Event} from 'app/types/event';
import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace';

import Content from './content';

type Props = {
stackType: STACK_TYPE;
projectId: Project['id'];
Expand Down Expand Up @@ -37,7 +38,7 @@ const Exception = ({
platform={platform}
/>
) : (
<ExceptionContent
<Content
type={stackType}
stackView={stackView}
values={values}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import Pills from 'app/components/pills';
import {IconInfo, IconOpen} from 'app/icons';
import {t} from 'app/locale';
import space from 'app/styles/space';
import {Mechanism} from 'app/types/stacktrace';
import {StackTraceMechanism} from 'app/types/stacktrace';
import {isUrl} from 'app/utils';
import {Theme} from 'app/utils/theme';

type Props = {
data: Mechanism;
data: StackTraceMechanism;
};

class ExceptionMechanism extends Component<Props> {
class Mechanism extends Component<Props> {
render() {
const mechanism = this.props.data;
const {type, description, help_link, handled, meta = {}, data = {}} = mechanism;
Expand Down Expand Up @@ -86,7 +86,7 @@ class ExceptionMechanism extends Component<Props> {
}
}

export default ExceptionMechanism;
export default Mechanism;

const Wrapper = styled('div')`
margin: ${space(2)} 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {STACK_VIEW} from 'app/types/stacktrace';
import {defined} from 'app/utils';
import EmptyMessage from 'app/views/settings/components/emptyMessage';

import StacktraceContent from './stacktraceContent';
import StacktraceContentV2 from './stacktraceContentV2';
import StacktraceContent from '../../stacktraceContent';
import StacktraceContentV2 from '../../stacktraceContentV2';

type Props = {
data: ExceptionValue['stacktrace'];
Expand All @@ -23,7 +23,7 @@ type Props = {
newestFirst?: boolean;
};

const ExceptionStacktraceContent = ({
const StackTrace = ({
stackView,
stacktrace,
chainedException,
Expand Down Expand Up @@ -101,4 +101,4 @@ const ExceptionStacktraceContent = ({
);
};

export default ExceptionStacktraceContent;
export default StackTrace;
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import ErrorBoundary from 'app/components/errorBoundary';
import rawStacktraceContent from 'app/components/events/interfaces/rawStacktraceContent';
import StacktraceContent from 'app/components/events/interfaces/stacktraceContent';
import StacktraceContentV2 from 'app/components/events/interfaces/stacktraceContentV2';
import {PlatformType} from 'app/types';
import {Event} from 'app/types/event';
import {STACK_VIEW, StacktraceType} from 'app/types/stacktrace';

import StacktraceContent from '../stacktraceContent';
import StacktraceContentV2 from '../stacktraceContentV2';

type Props = Pick<
React.ComponentProps<typeof StacktraceContentV2>,
'groupingCurrentLevel'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Props = {
platform: PlatformType;
eventId: Event['id'];
// XXX: Organization is NOT available for Shared Issues!
organization: Organization;
organization?: Organization;
} & Pick<ExceptionType, 'values'>;

type State = {
Expand Down
4 changes: 2 additions & 2 deletions static/app/types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {Field} from 'app/views/settings/components/forms/type';

import {DynamicSamplingRules} from './dynamicSampling';
import {Event} from './event';
import {Mechanism, RawStacktrace, StacktraceType} from './stacktrace';
import {RawStacktrace, StackTraceMechanism, StacktraceType} from './stacktrace';

export enum SentryInitRenderReactComponent {
INDICATORS = 'Indicators',
Expand Down Expand Up @@ -2046,7 +2046,7 @@ export type ExceptionValue = {
threadId: number | null;
stacktrace: StacktraceType | null;
rawStacktrace: RawStacktrace;
mechanism: Mechanism | null;
mechanism: StackTraceMechanism | null;
module: string | null;
frames: Frame[] | null;
};
Expand Down
2 changes: 1 addition & 1 deletion static/app/types/stacktrace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type MechanismMeta = {
};
};

export type Mechanism = {
export type StackTraceMechanism = {
handled: boolean;
synthetic: boolean;
type: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {mountWithTheme} from 'sentry-test/enzyme';

import ExceptionMechanism from 'app/components/events/interfaces/exceptionMechanism';
import ExceptionMechanism from 'app/components/events/interfaces/crashContent/exception/mechanism';

describe('ExceptionMechanism', () => {
describe('basic attributes', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import cloneDeep from 'lodash/cloneDeep';

import {mountWithTheme} from 'sentry-test/enzyme';

import ExceptionStacktraceContent from 'app/components/events/interfaces/exceptionStacktraceContent';
import ExceptionStacktraceContent from 'app/components/events/interfaces/crashContent/exception/stackTrace';
import EmptyMessage from 'app/views/settings/components/emptyMessage';

describe('ExceptionStacktraceContent', () => {
Expand Down