From 84d8c27b5f17ab8567b0b3667d95030f022a44e7 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Fri, 27 Sep 2024 23:52:38 +0900 Subject: [PATCH] dbus: return exported error for nil config Signed-off-by: Ophestra Umiker --- dbus/dbus.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dbus/dbus.go b/dbus/dbus.go index 70151cf..7a51d98 100644 --- a/dbus/dbus.go +++ b/dbus/dbus.go @@ -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