error.ts 623 B

1234567891011121314151617
  1. import type {RawReplayError} from 'sentry/utils/replays/types';
  2. type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U;
  3. export function RawReplayErrorFixture(
  4. error: Overwrite<Partial<RawReplayError>, {timestamp: Date}>
  5. ): RawReplayError {
  6. return {
  7. 'error.type': error['error.type'] ?? ([] as string[]),
  8. id: error.id ?? 'e123',
  9. issue: error.issue ?? 'JS-374',
  10. 'issue.id': error['issue.id'] ?? 3740335939,
  11. 'project.name': error['project.name'] ?? 'javascript',
  12. timestamp: error.timestamp.toISOString(),
  13. title: error.title ?? 'A Redirect with :orgId param on customer domain',
  14. };
  15. }