Skip to content

Commit

Permalink
fix: 错误无法 JSON.stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Jul 11, 2024
1 parent 9353923 commit 4af545b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main/src/models/posthog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ else {

export default {
capture(event: string, properties: Record<string, any>) {
if (typeof properties?.error === 'object' && properties.error.stack) {
properties.error = properties.error.stack;
}
client.capture({
event, properties,
distinctId: hostname,
Expand Down

0 comments on commit 4af545b

Please sign in to comment.