添加世界运行异常时的堆栈打印
This commit is contained in:
parent
37e06d2aaf
commit
0eb750b76a
3
world.go
3
world.go
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"math"
|
||||
"runtime/debug"
|
||||
"time"
|
||||
|
||||
"github.com/yohamta/donburi"
|
||||
@ -219,6 +220,8 @@ func (w *world) run() {
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
w.exception(err)
|
||||
slog.Error("世界运行异常", "error", err, "stack", string(debug.Stack()))
|
||||
debug.PrintStack()
|
||||
}
|
||||
}()
|
||||
for range w.ticker.C {
|
||||
|
Loading…
Reference in New Issue
Block a user