Skip to content

Commit

Permalink
interfaces: improvements to error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenstridge committed Jun 2, 2020
1 parent 1c5533b commit 9c307da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion interfaces/dbus/backend.go
Expand Up @@ -354,7 +354,7 @@ func BusNameOwner(bus, name string) (owner string, err error) {
case "system":
servicesDir = dirs.SnapDBusSystemServicesDir
default:
panic(bus)
return "", fmt.Errorf("unknown D-Bus bus %q", bus)
}
serviceFile := filepath.Join(servicesDir, name+".service")
return snapNameFromServiceFile(serviceFile)
Expand Down
2 changes: 1 addition & 1 deletion wrappers/services.go
Expand Up @@ -723,7 +723,7 @@ WantedBy={{.ServicesTarget}}
if appInfo.Daemon == "dbus" && len(appInfo.ActivatesOn) > 0 {
slot := appInfo.Slots[appInfo.ActivatesOn[len(appInfo.ActivatesOn)-1]]
if err := slot.Attr("name", &busName); err != nil {
logger.Noticef("could not get 'name' attribute of dbus slot %q: %v", slot.Name, err)
logger.Noticef("Cannot get 'name' attribute of dbus slot %q: %v", slot.Name, err)
}
}

Expand Down

0 comments on commit 9c307da

Please sign in to comment.