From 3e236333a77233cfcd96b6fc93be91e14ab7c680 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 18 May 2026 00:07:39 +0900 Subject: internal/rosa: panic error for invalid handle This enables recovery and better error handling for errors originating from external azalea files. Signed-off-by: Ophestra --- cmd/mbf/main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cmd/mbf/main.go') diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index df089e89..f3532326 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -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() -- cgit v1.3.1