internal/rosa: panic error for invalid handle
All checks were successful
Test / Create distribution (push) Successful in 1m4s
Test / Sandbox (push) Successful in 2m53s
Test / Hakurei (push) Successful in 3m52s
Test / ShareFS (push) Successful in 4m42s
Test / Sandbox (race detector) (push) Successful in 5m28s
Test / Hakurei (race detector) (push) Successful in 6m36s
Test / Flake checks (push) Successful in 1m23s

This enables recovery and better error handling for errors originating from external azalea files.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-18 00:07:39 +09:00
parent f24ae21af1
commit 3e236333a7
3 changed files with 217 additions and 195 deletions

View File

@@ -58,6 +58,19 @@ func main() {
log.Fatal("this program must not run as root")
}
defer func() {
r := recover()
if r == nil {
return
}
h, ok := r.(rosa.HandleError)
if !ok {
panic(r)
}
log.Fatal(h)
}()
ctx, stop := signal.NotifyContext(context.Background(),
syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
defer stop()