From b9c91dde0fee3a2e52166aa95de3165786a156e1 Mon Sep 17 00:00:00 2001 From: Neil Kakkar Date: Mon, 16 Sep 2024 10:26:01 +0100 Subject: [PATCH] prep release --- CHANGELOG.md | 4 ++++ posthog/client.py | 9 ++++----- posthog/test/test_client.py | 5 +---- posthog/version.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00d5d8c..3a6d679 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.6.6 - 2024-09-16 + +1. Fix manual capture support for in app frames + ## 3.6.5 - 2024-09-10 1. Fix django integration support for manual exception capture. diff --git a/posthog/client.py b/posthog/client.py index dc2f06d..9a73e85 100644 --- a/posthog/client.py +++ b/posthog/client.py @@ -89,11 +89,11 @@ def __init__( self.enable_exception_autocapture = enable_exception_autocapture self.exception_autocapture_integrations = exception_autocapture_integrations self.exception_capture = None - + if project_root is None: try: project_root = os.getcwd() - except Exception as e: + except Exception: project_root = None self.project_root = project_root @@ -395,12 +395,11 @@ def capture_exception( }, project_root=self.project_root, ) - print('prject root: ', self.project_root) all_exceptions_with_trace_and_in_app = event["exception"]["values"] properties = { - "$exception_type": all_exceptions_with_trace_and_in_app[-1].get("type"), - "$exception_message": all_exceptions_with_trace_and_in_app[-1].get("value"), + "$exception_type": all_exceptions_with_trace_and_in_app[0].get("type"), + "$exception_message": all_exceptions_with_trace_and_in_app[0].get("value"), "$exception_list": all_exceptions_with_trace_and_in_app, "$exception_personURL": f"{remove_trailing_slash(self.raw_host)}/project/{self.api_key}/person/{distinct_id}", **properties, diff --git a/posthog/test/test_client.py b/posthog/test/test_client.py index f73b39f..ba542ba 100644 --- a/posthog/test/test_client.py +++ b/posthog/test/test_client.py @@ -227,10 +227,7 @@ def test_basic_capture_exception_with_no_exception_given(self): self.assertEqual( capture_call[2]["$exception_list"][0]["stacktrace"]["frames"][0]["module"], "posthog.test.test_client" ) - self.assertEqual( - capture_call[2]["$exception_list"][0]["stacktrace"]["frames"][0]["in_app"], True - ) - + self.assertEqual(capture_call[2]["$exception_list"][0]["stacktrace"]["frames"][0]["in_app"], True) def test_basic_capture_exception_with_no_exception_happening(self): diff --git a/posthog/version.py b/posthog/version.py index ccbc523..cc2ac6e 100644 --- a/posthog/version.py +++ b/posthog/version.py @@ -1,4 +1,4 @@ -VERSION = "3.6.5" +VERSION = "3.6.6" if __name__ == "__main__": print(VERSION, end="") # noqa: T201