add debug

This commit is contained in:
2023-06-13 23:18:54 +01:00
parent 8443b20949
commit ec53db45d5
9 changed files with 98 additions and 71 deletions

View File

@@ -15,26 +15,32 @@ func newscope() ArObject {
}
func main() {
defer func() {
if r := recover(); r != nil {
fmt.Println("There was a fundamental error in argon v3 that caused it to crash.")
fmt.Println()
if fork {
fmt.Println("This is a fork of Open-Argon. Please report this to the fork's maintainer.")
fmt.Println("Fork repo:", forkrepo)
fmt.Println("Fork issue page:", forkissuesPage)
debugPrintln("In debug mode...")
if !debug {
defer func() {
if r := recover(); r != nil {
fmt.Println("There was a fundamental error in argon v3 that caused it to crash.")
fmt.Println()
} else {
fmt.Println("Please report this to the Open-Argon team.")
fmt.Println("Main repo:", mainrepo)
fmt.Println("Issue page:", mainissuesPage)
fmt.Println("website:", website)
fmt.Println("docs:", docs)
fmt.Println()
if fork {
fmt.Println("This is a fork of Open-Argon. Please report this to the fork's maintainer.")
fmt.Println("Fork repo:", forkrepo)
fmt.Println("Fork issue page:", forkissuesPage)
fmt.Println()
} else {
fmt.Println("Please report this to the Open-Argon team.")
fmt.Println("Main repo:", mainrepo)
fmt.Println("Issue page:", mainissuesPage)
fmt.Println()
}
fmt.Println("please include the following information:")
fmt.Println("panic:", r)
os.Exit(1)
}
fmt.Println("please include the following information:")
fmt.Println("panic:", r)
os.Exit(1)
}
}()
}()
}
initRandom()
garbageCollect()
global := makeGlobal()