From 6be388e1082a256a06d1ef127a9abb485f5ee145 Mon Sep 17 00:00:00 2001 From: olebeck <31539311+olebeck@users.noreply.github.com> Date: Tue, 6 Sep 2022 15:24:08 +0200 Subject: [PATCH] add instructions for issues --- cmd/bedrocktool/main.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmd/bedrocktool/main.go b/cmd/bedrocktool/main.go index 44338ab..4f34e8b 100644 --- a/cmd/bedrocktool/main.go +++ b/cmd/bedrocktool/main.go @@ -29,6 +29,24 @@ func exit() { } func main() { + defer func() { + if err := recover(); err != nil { + logrus.Errorf("Fatal Error occurred.") + println("") + println("--COPY FROM HERE--") + logrus.Infof("Version: %s", utils.Version) + logrus.Infof("Cmdline: %s", os.Args) + logrus.Errorf("Error: %s", err) + println("--END COPY HERE--") + println("") + println("if you want to report this error, please open an issue at") + println("https://github.com/bedrock-tool/bedrocktool/issues") + println("And attach the error info, describe what you did to get this error.") + println("Thanks!\n") + os.Exit(1) + } + }() + logrus.SetLevel(logrus.DebugLevel) if utils.Version != "" { logrus.Infof("bedrocktool version: %s", utils.Version)