From a9e65272bc6394b2f43ceeafe13e562dd73a260c Mon Sep 17 00:00:00 2001 From: David Newell Date: Tue, 19 Nov 2024 10:57:09 +0000 Subject: [PATCH 1/2] chore: add type to stack --- posthog/exception_utils.py | 4 ++-- posthog/test/test_client.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/posthog/exception_utils.py b/posthog/exception_utils.py index 75282d10..17b7630d 100644 --- a/posthog/exception_utils.py +++ b/posthog/exception_utils.py @@ -418,7 +418,7 @@ def current_stacktrace( frames.reverse() - return {"frames": frames} + return {"frames": frames, "type": "raw"} def get_errno(exc_value): @@ -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 diff --git a/posthog/test/test_client.py b/posthog/test/test_client.py index a3a1bfad..feb5dd2e 100644 --- a/posthog/test/test_client.py +++ b/posthog/test/test_client.py @@ -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", From 409a897abbc70e95ac4ad608a8a8988ace0c2de3 Mon Sep 17 00:00:00 2001 From: David Newell Date: Tue, 19 Nov 2024 10:58:27 +0000 Subject: [PATCH 2/2] bump versionm --- CHANGELOG.md | 4 ++++ posthog/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dc79767..f5008e64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/posthog/version.py b/posthog/version.py index 5b234a88..f0f5a9e2 100644 --- a/posthog/version.py +++ b/posthog/version.py @@ -1,4 +1,4 @@ -VERSION = "3.7.1" +VERSION = "3.7.2" if __name__ == "__main__": print(VERSION, end="") # noqa: T201