From bac4f3b7c84656acd1cf64b19c7d8ea66cc14615 Mon Sep 17 00:00:00 2001 From: Oliver Browne Date: Fri, 13 Jun 2025 22:20:26 +0300 Subject: [PATCH 1/2] just check if it's an exception first --- posthog/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/client.py b/posthog/client.py index a6ce4423..707dcfc5 100644 --- a/posthog/client.py +++ b/posthog/client.py @@ -708,7 +708,7 @@ def capture_exception( ) # Mark the exception as captured to prevent duplicate captures - if exception is not None: + if exception is not None and isinstance(exception, BaseException): setattr(exception, "__posthog_exception_captured", True) return res From 22c58bc9d6d0490adf8e25c5293f18661915e4f9 Mon Sep 17 00:00:00 2001 From: Oliver Browne Date: Fri, 13 Jun 2025 22:33:15 +0300 Subject: [PATCH 2/2] version bump --- CHANGELOG.md | 4 ++++ posthog/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 446992f8..719c58e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.10.0 - 2025-06-13 + +- fix: no longer fail in autocapture. + ## 4.9.0 - 2025-06-13 - feat(ai): track reasoning and cache tokens in the LangChain callback diff --git a/posthog/version.py b/posthog/version.py index f19455b9..242fe013 100644 --- a/posthog/version.py +++ b/posthog/version.py @@ -1,4 +1,4 @@ -VERSION = "4.9.0" +VERSION = "4.10.0" if __name__ == "__main__": print(VERSION, end="") # noqa: T201