Skip to content

Commit 5a7f324

Browse files
authored
fix(err): always safe_str exception values (#267)
* always safe_str * bump version
1 parent e13c428 commit 5a7f324

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 5.3.0 - 2025-06-19
2+
3+
- fix: safely handle exception values
4+
15
# 5.2.0 - 2025-06-19
26

37
- feat: construct artificial stack traces if no traceback is available on a captured exception

posthog/exception_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,14 @@ def get_errno(exc_value):
438438

439439
def get_error_message(exc_value):
440440
# type: (Optional[BaseException]) -> str
441-
return (
441+
message = (
442442
getattr(exc_value, "message", "")
443443
or getattr(exc_value, "detail", "")
444-
or safe_str(exc_value)
444+
or exc_value
445445
)
446446

447+
return safe_str(message)
448+
447449

448450
def single_exception_from_error_tuple(
449451
exc_type, # type: Optional[type]

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "5.2.0"
1+
VERSION = "5.3.0"
22

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

0 commit comments

Comments
 (0)