dbus: return exported error for nil config

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-09-27 23:52:38 +09:00
parent ee2f5ed6ac
commit 84d8c27b5f
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
1 changed files with 5 additions and 1 deletions

View File

@ -22,6 +22,10 @@ type Proxy struct {
lock sync.RWMutex
}
var (
ErrConfig = errors.New("no configuration to seal")
)
func (p *Proxy) String() string {
if p == nil {
return "(invalid dbus proxy)"
@ -51,7 +55,7 @@ func (p *Proxy) Seal(session, system *Config) error {
}
if session == nil && system == nil {
return errors.New("no configuration to seal")
return ErrConfig
}
var args []string