Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBus connection error handling #32

Closed
acrisci opened this issue Mar 18, 2019 · 0 comments · Fixed by #34
Closed

DBus connection error handling #32

acrisci opened this issue Mar 18, 2019 · 0 comments · Fixed by #34

Comments

@acrisci
Copy link
Member

acrisci commented Mar 18, 2019

Errors with the underlying connection to DBus may happen asynchonously. Establishing the connection and exporting the name on the bus is async and may fail after the constructor returns the player.

  • connection to dbus cannot be established
  • the name cannot be exported
  • dbus connection is closed after connection is established

Error handling should be for debug logging to explain what happened and also give the user an option to retry the connection.

Best solution is probably to have an error event on the player with the original error and a message of what went wrong.

player.on('error', (err, message) => { /* handle error */ })

Maybe give a hint to whether the player is connected after the error with a player property.

We can proxy the dbus-next connection error events into this when they happen.

acrisci added a commit to acrisci/mpris-service that referenced this issue Mar 25, 2019
Add an `error` event to the Player so users can handle DBus connection
errors. Proxy dbus connection and export errors through this event.

Update dbus-next to 0.4 and use the new interface export api.

Update tests for the new features and add a `ping` fixture.

fixes dbusjs#32
acrisci added a commit to acrisci/mpris-service that referenced this issue Mar 25, 2019
Add an `error` event to the Player so users can handle DBus connection
errors. Proxy dbus connection and export errors through this event.

Update dbus-next to 0.4 and use the new interface export api.

Update tests for the new features and add a `ping` fixture.

fixes dbusjs#32
acrisci added a commit to acrisci/mpris-service that referenced this issue Mar 26, 2019
Add an `error` event to the Player so users can handle DBus connection
errors. Proxy dbus connection and export errors through this event.

Update dbus-next to 0.4 and use the new interface export api.

Update tests for the new features and add a `ping` fixture.

fixes dbusjs#32
acrisci added a commit to acrisci/mpris-service that referenced this issue Mar 26, 2019
Add an `error` event to the Player so users can handle DBus connection
errors. Proxy dbus connection and export errors through this event.

Update dbus-next to 0.4 and use the new interface export api.

Update tests for the new features and add a `ping` fixture.

fixes dbusjs#32
acrisci added a commit to acrisci/mpris-service that referenced this issue Mar 26, 2019
Add an `error` event to the Player so users can handle DBus connection
errors. Proxy dbus connection and export errors through this event.

Update dbus-next to 0.4 and use the new interface export api.

Update tests for the new features and add a `ping` fixture.

fixes dbusjs#32
emersion pushed a commit that referenced this issue Mar 27, 2019
Add an `error` event to the Player so users can handle DBus connection
errors. Proxy dbus connection and export errors through this event.

Update dbus-next to 0.4 and use the new interface export api.

Update tests for the new features and add a `ping` fixture.

fixes #32
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 a pull request may close this issue.

1 participant