Skip to content

Commit

Permalink
Merge pull request #371 from stgraber/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
tych0 authored Jan 8, 2024
2 parents e78272d + f440df3 commit 07b556d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion shared/cliconfig/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ func (c *Config) GetInstanceServer(name string) (incus.InstanceServer, error) {
var netErr *net.OpError

if errors.As(err, &netErr) {
return nil, fmt.Errorf("The incus daemon doesn't appear to be started (socket path: %s)", netErr.Addr)
errMsg := netErr.Unwrap().Error()
if errMsg == "connect: connection refused" || errMsg == "connect: no such file or directory" {
return nil, fmt.Errorf("The incus daemon doesn't appear to be started (socket path: %s)", netErr.Addr)
} else if errMsg == "connect: permission denied" {
return nil, fmt.Errorf("You don't have the needed permissions to talk to the incus daemon (socket path: %s)", netErr.Addr)
}

return nil, err
}

return nil, err
Expand Down

0 comments on commit 07b556d

Please sign in to comment.