Skip to content

Commit

Permalink
chore: add type to stack (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Nov 19, 2024
1 parent 39f72a0 commit 8ae3f2b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.7.2 - 2024-11-19

1. Add `type` property to exception stacks.

## 3.7.1 - 2024-10-24

1. Add `platform` property to each frame of exception stacks.
Expand Down
4 changes: 2 additions & 2 deletions posthog/exception_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def current_stacktrace(

frames.reverse()

return {"frames": frames}
return {"frames": frames, "type": "raw"}


def get_errno(exc_value):
Expand Down Expand Up @@ -504,7 +504,7 @@ def single_exception_from_error_tuple(
]

if frames:
exception_value["stacktrace"] = {"frames": frames}
exception_value["stacktrace"] = {"frames": frames, "type": "raw"}

return exception_value

Expand Down
4 changes: 4 additions & 0 deletions posthog/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ def test_basic_capture_exception_with_no_exception_given(self):
self.assertEqual(capture_call[2]["$exception_list"][0]["module"], None)
self.assertEqual(capture_call[2]["$exception_list"][0]["type"], "Exception")
self.assertEqual(capture_call[2]["$exception_list"][0]["value"], "test exception")
self.assertEqual(
capture_call[2]["$exception_list"][0]["stacktrace"]["type"],
"raw",
)
self.assertEqual(
capture_call[2]["$exception_list"][0]["stacktrace"]["frames"][0]["filename"],
"posthog/test/test_client.py",
Expand Down
2 changes: 1 addition & 1 deletion posthog/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "3.7.1"
VERSION = "3.7.2"

if __name__ == "__main__":
print(VERSION, end="") # noqa: T201

0 comments on commit 8ae3f2b

Please sign in to comment.