Skip to content

Catch UnicodeDecodeErrors if invalid utf-8 data is sent - #182

Merged
simon-ess merged 1 commit into
masterfrom
catch_unicde_error
Oct 6, 2026
Merged

simon-ess merged 1 commit into
masterfrom
catch_unicde_error

Conversation

@simon-ess

Copy link
Copy Markdown
Contributor

This applies to both record names and info tags.

@simon-ess
simon-ess requested a review from jacomago October 5, 2026 12:41
@simon-ess simon-ess self-assigned this Oct 5, 2026
@simon-ess
simon-ess force-pushed the catch_unicde_error branch 3 times, most recently from 69c91f5 to 865f156 Compare October 5, 2026 12:49
Comment thread server/recceiver/recast.py Outdated
log.error("Ignoring info update")
return self.getInitialState()
except messages.KeyValueDecodeError as e:
log.error("Error decoding key/value pair: '{}': '{}'", e.key, e.value)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably swap to

log.exception("Error decoding key/value pair: '{}': '{}'", e.key, e.value)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Also add host/port to log message since we've noted that we are often missing this.

@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

@simon-ess
simon-ess merged commit 6494fca into master Oct 6, 2026
28 checks passed
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