aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/uevent
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-27 22:58:16 +0900
committerOphestra <cat@gensokyo.uk>2026-03-27 22:58:16 +0900
commit8766fddcb3a8047673e513ce0d60c8c46edb5ba1 (patch)
treee071504afe2b0ec88a92d36a324c3cc9703cc31b /internal/uevent
parent2745602be3cb9fc200958f298c5f423007b6f9e1 (diff)
internal/uevent: recoverable errors
This runs in the Rosa OS init, so recover as much as possible, as otherwise it is likely to require a full system reboot to resume event processing. The caller is responsible for reporting the error. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/uevent')
-rw-r--r--internal/uevent/action.go3
-rw-r--r--internal/uevent/uevent.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/internal/uevent/action.go b/internal/uevent/action.go
index 4f1f4f79..3eeb4d7e 100644
--- a/internal/uevent/action.go
+++ b/internal/uevent/action.go
@@ -59,6 +59,9 @@ func (act KobjectAction) MarshalText() ([]byte, error) {
// not yet supported by this package.
type UnsupportedActionError string
+var _ Recoverable = UnsupportedActionError("")
+
+func (UnsupportedActionError) recoverable() {}
func (e UnsupportedActionError) Error() string {
return "unsupported kobject_action " + strconv.Quote(string(e))
}
diff --git a/internal/uevent/uevent.go b/internal/uevent/uevent.go
index 674938b1..a97423a8 100644
--- a/internal/uevent/uevent.go
+++ b/internal/uevent/uevent.go
@@ -9,6 +9,9 @@ import (
"hakurei.app/internal/netlink"
)
+// Recoverable is satisfied by errors that are safe to recover from.
+type Recoverable interface{ recoverable() }
+
// Conn represents a NETLINK_KOBJECT_UEVENT socket.
type Conn struct{ conn *netlink.Conn }