Skip to content

Commit 1582a4b

Browse files
committed
print stack on panic
1 parent 8efdf33 commit 1582a4b

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/ProtobufBot/Go-Mirai-Client
33
go 1.15
44

55
require (
6-
github.com/Mrs4s/MiraiGo v0.0.0-20210107163750-ce4834c2ba71
6+
github.com/Mrs4s/MiraiGo v0.0.0-20210108093149-f40ac95fffa4
77
github.com/a8m/syncmap v0.0.0-20200818084611-4bbbd178de97 // indirect
88
github.com/fanliao/go-promise v0.0.0-20141029170127-1890db352a72
99
github.com/gin-gonic/gin v1.6.3

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ github.com/Mrs4s/MiraiGo v0.0.0-20210107160254-d55ab63e19a3 h1:803dvcwzOtCIff1lV
4444
github.com/Mrs4s/MiraiGo v0.0.0-20210107160254-d55ab63e19a3/go.mod h1:HW2e375lCQiRwtuA/LV6ZVTsi7co1TRfBn+L5Ow77Bo=
4545
github.com/Mrs4s/MiraiGo v0.0.0-20210107163750-ce4834c2ba71 h1:WAVoBY4G2BC5Dyw1A45r/sVua65hsBVYcncR42hEGrk=
4646
github.com/Mrs4s/MiraiGo v0.0.0-20210107163750-ce4834c2ba71/go.mod h1:HW2e375lCQiRwtuA/LV6ZVTsi7co1TRfBn+L5Ow77Bo=
47+
github.com/Mrs4s/MiraiGo v0.0.0-20210108093149-f40ac95fffa4 h1:1AEB2CdtzpDjQzpQFGVjV203ybjCSaqo/gmKdYmr8Jo=
48+
github.com/Mrs4s/MiraiGo v0.0.0-20210108093149-f40ac95fffa4/go.mod h1:HW2e375lCQiRwtuA/LV6ZVTsi7co1TRfBn+L5Ow77Bo=
4749
github.com/a8m/syncmap v0.0.0-20200818084611-4bbbd178de97/go.mod h1:f3iF7/3t9i9hsYF8DPgT0XeIVyNzevhMCKf2445Q6pE=
4850
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
4951
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=

pkg/util/util.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"net/http"
1111
"os"
1212
"runtime"
13+
"runtime/debug"
1314
"strings"
1415
"time"
1516
"unsafe"
@@ -103,6 +104,7 @@ func SafeGo(fn func()) {
103104
e := recover()
104105
if e != nil {
105106
log.Errorf("err recovered: %+v", e)
107+
log.Errorf("%s", debug.Stack())
106108
}
107109
}()
108110
fn()

0 commit comments

Comments
 (0)