index.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import {ExceptionType, ExceptionValue, PlatformType} from 'sentry/types';
  2. import Exception from './exception';
  3. import Stacktrace from './stackTrace';
  4. type ExceptionProps = React.ComponentProps<typeof Exception>;
  5. type Props = Pick<
  6. ExceptionProps,
  7. | 'stackType'
  8. | 'stackView'
  9. | 'projectId'
  10. | 'event'
  11. | 'newestFirst'
  12. | 'groupingCurrentLevel'
  13. | 'hasHierarchicalGrouping'
  14. > & {
  15. exception?: ExceptionType;
  16. stacktrace?: ExceptionValue['stacktrace'];
  17. };
  18. function CrashContent({
  19. event,
  20. stackView,
  21. stackType,
  22. newestFirst,
  23. projectId,
  24. groupingCurrentLevel,
  25. hasHierarchicalGrouping,
  26. exception,
  27. stacktrace,
  28. }: Props) {
  29. const platform = (event.platform ?? 'other') as PlatformType;
  30. if (exception) {
  31. return (
  32. <Exception
  33. stackType={stackType}
  34. stackView={stackView}
  35. projectId={projectId}
  36. newestFirst={newestFirst}
  37. event={event}
  38. platform={platform}
  39. values={exception.values}
  40. groupingCurrentLevel={groupingCurrentLevel}
  41. hasHierarchicalGrouping={hasHierarchicalGrouping}
  42. />
  43. );
  44. }
  45. if (stacktrace) {
  46. return (
  47. <Stacktrace
  48. stacktrace={stacktrace}
  49. stackView={stackView}
  50. newestFirst={newestFirst}
  51. event={event}
  52. platform={platform}
  53. groupingCurrentLevel={groupingCurrentLevel}
  54. hasHierarchicalGrouping={hasHierarchicalGrouping}
  55. />
  56. );
  57. }
  58. return null;
  59. }
  60. export default CrashContent;