summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/lrstanley/girc/handler.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-09-07 21:35:45 +0200
committerGitHub <noreply@github.com>2019-09-07 21:35:45 +0200
commit1532f6e42798d1071c8a97423e838338bed7b570 (patch)
tree4ae23c4a5da97e8c1d86a28460340fa2cb5e1c78 /vendor/github.com/lrstanley/girc/handler.go
parent9327810bbfe9cf0da2415d223fc642d943ff2ade (diff)
downloadmatterbridge-msglm-1532f6e42798d1071c8a97423e838338bed7b570.tar.gz
matterbridge-msglm-1532f6e42798d1071c8a97423e838338bed7b570.tar.bz2
matterbridge-msglm-1532f6e42798d1071c8a97423e838338bed7b570.zip
Update lrstanley/girc vendor (#884)
Diffstat (limited to 'vendor/github.com/lrstanley/girc/handler.go')
-rw-r--r--vendor/github.com/lrstanley/girc/handler.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/vendor/github.com/lrstanley/girc/handler.go b/vendor/github.com/lrstanley/girc/handler.go
index ec717de6..4832262a 100644
--- a/vendor/github.com/lrstanley/girc/handler.go
+++ b/vendor/github.com/lrstanley/girc/handler.go
@@ -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