internal/uevent: recoverable errors
All checks were successful
Test / Create distribution (push) Successful in 1m13s
Test / Sandbox (push) Successful in 3m1s
Test / Hakurei (push) Successful in 4m9s
Test / ShareFS (push) Successful in 4m17s
Test / Sandbox (race detector) (push) Successful in 5m36s
Test / Hakurei (race detector) (push) Successful in 6m42s
Test / Flake checks (push) Successful in 1m26s
All checks were successful
Test / Create distribution (push) Successful in 1m13s
Test / Sandbox (push) Successful in 3m1s
Test / Hakurei (push) Successful in 4m9s
Test / ShareFS (push) Successful in 4m17s
Test / Sandbox (race detector) (push) Successful in 5m36s
Test / Hakurei (race detector) (push) Successful in 6m42s
Test / Flake checks (push) Successful in 1m26s
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>
This commit is contained in:
@@ -59,6 +59,9 @@ func (act KobjectAction) MarshalText() ([]byte, error) {
|
|||||||
// not yet supported by this package.
|
// not yet supported by this package.
|
||||||
type UnsupportedActionError string
|
type UnsupportedActionError string
|
||||||
|
|
||||||
|
var _ Recoverable = UnsupportedActionError("")
|
||||||
|
|
||||||
|
func (UnsupportedActionError) recoverable() {}
|
||||||
func (e UnsupportedActionError) Error() string {
|
func (e UnsupportedActionError) Error() string {
|
||||||
return "unsupported kobject_action " + strconv.Quote(string(e))
|
return "unsupported kobject_action " + strconv.Quote(string(e))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ import (
|
|||||||
"hakurei.app/internal/netlink"
|
"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.
|
// Conn represents a NETLINK_KOBJECT_UEVENT socket.
|
||||||
type Conn struct{ conn *netlink.Conn }
|
type Conn struct{ conn *netlink.Conn }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user