eventStacktraceException.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {EventFixture} from 'sentry-fixture/event';
  2. import {EventEntryFixture} from 'sentry-fixture/eventEntry';
  3. import {EntryType} from 'sentry/types';
  4. const exception = EventEntryFixture({
  5. type: EntryType.EXCEPTION,
  6. data: {
  7. values: [
  8. {
  9. module: 'example.application',
  10. type: 'Error',
  11. value: 'an error occurred',
  12. stacktrace: {
  13. frames: [
  14. {
  15. function: 'main',
  16. module: 'example.application',
  17. lineNo: 1,
  18. filename: 'application',
  19. inApp: true,
  20. },
  21. {
  22. function: 'doThing',
  23. module: 'example.application',
  24. lineNo: 2,
  25. filename: 'application',
  26. inApp: true,
  27. },
  28. ],
  29. },
  30. },
  31. ],
  32. },
  33. });
  34. const message = {
  35. type: 'message',
  36. data: {
  37. formatted: 'Something is broken',
  38. },
  39. };
  40. export function EventStacktraceExceptionFixture(params = {}) {
  41. return EventFixture({entries: [{...exception}], ...params});
  42. }
  43. export function EventStacktraceMessageFixture(params = {}) {
  44. return EventFixture({entries: [{...message}], ...params});
  45. }