aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-18 00:07:39 +0900
committerOphestra <cat@gensokyo.uk>2026-05-18 00:07:39 +0900
commit3e236333a77233cfcd96b6fc93be91e14ab7c680 (patch)
tree97b4bc6703d6763a0c24455a33ce18d637966c1c /cmd
parentf24ae21af111e0ce34f62a37ddb4a9fc18166ae6 (diff)
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 <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mbf/main.go13
1 files changed, 13 insertions, 0 deletions
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()