Skip to content

Gracefully handling dbus init errors #730

@robinvd

Description

@robinvd

Description
currently when no x-server is available (or other dbus errors) we just panic, but this could just be a warning and then continue without dbus.

To Reproduce

  1. compile with dbus enables d
  2. run without an x-server (i thing unsetting DISPLAY should also work).
  3. run spotifyd normally
  4. crashes with a panic

Expected behavior
a warning, but not a panic

Logs
see #729 for a relevant issue.

Compilation flags

  • dbus_mpris
  • dbus_keyring
  • alsa_backend
  • portaudio_backend
  • pulseaudio_backend
  • rodio_backend

a quicker solution might be to provide a command line option to disable dbus.

relevant code locations:

  • creating a dbus instance
    self.spotifyd_state.dbus_mpris_server = new_dbus_server(

    this could be put behind an if triggered by a command line option, thus avoiding the panic.
  • Connection::get_private(BusType::Session).expect("Failed to initialize DBus connection"),

    this is where the panic happens, instead there could be a logger warning, and return something else

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA functionality or parts of a program that do not work as intendedenhancementA new feature that would improve Spotifydgood first issueAn easy to implement issue, good for first time contributors or people new to open sourcehelp wantedIssues that need help since the assigned person has little to no knowledge about the topic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions