-
Notifications
You must be signed in to change notification settings - Fork 244
Description
I recently debugged an issue where a client would never receive a response from a method call if said method call returned a dbus.Error. The client would basically just time out.
I attached a debugger and started looking for the cause and found this:
- An error is returned when encoding the error
Line 204 in e523abc
| return err |
- The error bubbles
Line 807 in e523abc
| return h.conn.SendMessage(msg) |
- The error bubbles
Line 495 in e523abc
| err := conn.outHandler.sendAndIfClosed(msg, ifClosed) |
- The error bubbles
Line 503 in e523abc
| func (conn *Conn) handleSendError(msg *Message, err error) { |
- The error is silently dropped
Line 511 in e523abc
| conn.serialGen.RetireSerial(msg.serial) |
The cause was that the error's name was not a valid name. It was akin to failed to perform method rather than org.freedesktop.DBus.Error.InvalidArgs.
For v6 I suggest for that validation to happen in dbus.NewError, with an error returned if it fails. But for v5 it would be really nice to surface this error one way or another.