4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-04 19:27:45 +00:00

Update lrstanley/girc vendor (#884)

This commit is contained in:
Wim
2019-09-07 21:35:45 +02:00
committed by GitHub
parent 9327810bbf
commit 1532f6e427
13 changed files with 420 additions and 101 deletions

View File

@ -431,17 +431,27 @@ func recoverHandlerPanic(client *Client, event *Event, id string, skip int) {
return
}
var file string
var file, function string
var line int
var ok bool
_, file, line, ok = runtime.Caller(skip)
var pcs [10]uintptr
frames := runtime.CallersFrames(pcs[:runtime.Callers(skip, pcs[:])])
for {
frame, _ := frames.Next()
file = frame.File
line = frame.Line
function = frame.Function
break
}
err := &HandlerError{
Event: *event,
ID: id,
File: file,
Line: line,
Func: function,
Panic: perr,
Stack: debug.Stack(),
callOk: ok,
@ -460,6 +470,7 @@ type HandlerError struct {
ID string // ID is the CUID of the handler.
File string // File is the file from where the panic originated.
Line int // Line number where panic originated.
Func string // Function name where panic originated.
Panic interface{} // Panic is the error that was passed to panic().
Stack []byte // Stack is the call stack. Note you may have to skip 1 or 2 due to debug functions.
callOk bool