diff --git a/main.go b/main.go index 7fa40ed..e379a73 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,21 @@ // Fast tldr console client package main -import "github.com/Yakiyo/tilde/cmd" +import ( + "github.com/Yakiyo/tilde/cmd" + "github.com/charmbracelet/log" +) func main() { + defer panicHandler() + cmd.Execute() } + +// handle unexpected panics +func panicHandler() { + if err := recover(); err != nil { + log.Error("Unhandled error cause panic. Please consider filing a bug at https://github.com/Yakiyo/tilde") + log.Fatal(err) + } +} \ No newline at end of file