Skip to content

Fix silent serialization failure when publishing non-JSON-serializable objects#229

Open
jguz-pubnub wants to merge 2 commits intomasterfrom
fix/serialization-failure
Open

Fix silent serialization failure when publishing non-JSON-serializable objects#229
jguz-pubnub wants to merge 2 commits intomasterfrom
fix/serialization-failure

Conversation

@jguz-pubnub
Copy link
Contributor

No description provided.

@jguz-pubnub jguz-pubnub requested a review from parfeon as a code owner February 9, 2026 12:23
@pubnub-ops-terraform
Copy link

pubnub-ops-terraform commented Feb 9, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment on lines +33 to +43
except TypeError as e:
exc = PubNubException(
errormsg=str(e),
pn_error=PNERR_JSON_NOT_SERIALIZABLE
)
status = PNStatus()
status.category = PNStatusCategory.PNSerializationErrorCategory
status.error = True
status.error_data = PNErrorData(str(exc), exc)
exc.status = status
raise exc
Copy link
Contributor Author

@jguz-pubnub jguz-pubnub Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error structure has a circular reference, PubNubException.status.error_data.exception points back to the same PubNubException. This PR implements a fix that works within the current model to prevent regressions, but the error hierarchy would benefit from being revisited in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants