posthog-node 4.10.0 → 4.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { createReadStream } from 'node:fs';
3
3
  import { createInterface } from 'node:readline';
4
4
  import { posix, dirname, sep } from 'node:path';
5
5
 
6
- var version = "4.10.0";
6
+ var version = "4.10.1";
7
7
 
8
8
  var PostHogPersistedProperty;
9
9
  (function (PostHogPersistedProperty) {
@@ -3393,18 +3393,26 @@ function createEventProcessor(_posthog, {
3393
3393
  const personUrl = new URL(`/project/${_posthog.apiKey}/person/${userId}`, uiHost).toString();
3394
3394
  event.tags['PostHog Person URL'] = personUrl;
3395
3395
  const exceptions = event.exception?.values || [];
3396
- exceptions.map(exception => {
3397
- if (exception.stacktrace) {
3398
- exception.stacktrace.type = 'raw';
3399
- }
3400
- });
3396
+ const exceptionList = exceptions.map(exception => ({
3397
+ ...exception,
3398
+ stacktrace: exception.stacktrace ? {
3399
+ ...exception.stacktrace,
3400
+ type: 'raw',
3401
+ frames: (exception.stacktrace.frames || []).map(frame => {
3402
+ return {
3403
+ ...frame,
3404
+ platform: 'node:javascript'
3405
+ };
3406
+ })
3407
+ } : undefined
3408
+ }));
3401
3409
  const properties = {
3402
3410
  // PostHog Exception Properties,
3403
3411
  $exception_message: exceptions[0]?.value || event.message,
3404
3412
  $exception_type: exceptions[0]?.type,
3405
3413
  $exception_personURL: personUrl,
3406
3414
  $exception_level: event.level,
3407
- $exception_list: exceptions,
3415
+ $exception_list: exceptionList,
3408
3416
  // Sentry Exception Properties
3409
3417
  $sentry_event_id: event.event_id,
3410
3418
  $sentry_exception: event.exception,