eventStacktraceException.js 1010 B

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