Skip to content

errors: Handle malformed messages in parse_dbus_error#3206

Open
gfrmin wants to merge 1 commit into
blueman-project:mainfrom
gfrmin:robustparsedbuserror
Open

errors: Handle malformed messages in parse_dbus_error#3206
gfrmin wants to merge 1 commit into
blueman-project:mainfrom
gfrmin:robustparsedbuserror

Conversation

@gfrmin
Copy link
Copy Markdown

@gfrmin gfrmin commented Apr 14, 2026

parse_dbus_error assumes the exception message always has the form gerror:dbus_error:message and does an unchecked split(':', 2) unpack. If BlueZ (or a proxy/glib path) ever produces a message with fewer colons, this raises ValueError from inside the error handler itself, masking the original failure.

Wrap the split in try/except and fall back to returning a plain BluezDBusException with the raw message.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@infirit infirit left a comment

Choose a reason for hiding this comment

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

The mypy errors are unrelated so feel free to ignore them until we fixed them in main.

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