Skip to content

Commit 099aeff

Browse files
[Error Boundary] Correct type for stack property in widget-rendering-error:ti (#3045)
## Summary: Remove "undefined" from stack property type definition. Issue: LEMS-3714 Author: mark-fitzgerald Reviewers: catandthemachines Required Reviewers: Approved By: catandthemachines Checks: ⏭️ 1 check has been skipped, ✅ 10 checks were successful Pull Request URL: #3045
1 parent 9201e18 commit 099aeff

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changeset/tricky-radios-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@khanacademy/perseus-core": patch
3+
---
4+
5+
[Error Boundary] Correct type for stack property in widget-rendering-error:ti

packages/perseus-core/src/analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type PerseusAnalyticsEvent =
2323
widgetType: string;
2424
widgetId: string;
2525
message: string;
26-
stack: string | undefined;
26+
stack: string;
2727
userAgent: string;
2828
};
2929
}

packages/perseus/src/widget-container.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ class WidgetContainer extends React.Component<Props, State> {
176176
widgetType: type,
177177
widgetId: this.props.id,
178178
message: error.message,
179-
stack: error.stack,
179+
stack:
180+
error.stack ??
181+
"No stack trace available",
180182
userAgent: userAgent,
181183
},
182184
});

0 commit comments

Comments
 (0)