MCPcopy Create free account
hub / github.com/kataras/iris / RuntimeCallerStack

Function RuntimeCallerStack

_examples/database/mongodb/httputil/error.go:25–44  ·  view source on GitHub ↗

RuntimeCallerStack returns the app's `file:line` stacktrace to give more information about an error cause.

()

Source from the content-addressed store, hash-verified

23// RuntimeCallerStack returns the app's `file:line` stacktrace
24// to give more information about an error cause.
25func RuntimeCallerStack() (s string) {
26 var pcs [10]uintptr
27 n := runtime.Callers(1, pcs[:])
28 frames := runtime.CallersFrames(pcs[:n])
29
30 for {
31 frame, more := frames.Next()
32 for _, fn := range validStackFuncs {
33 if fn(frame.File) {
34 s += fmt.Sprintf("\n\t\t\t%s:%d", frame.File, frame.Line)
35 }
36 }
37
38 if !more {
39 break
40 }
41 }
42
43 return s
44}
45
46// HTTPError describes an HTTP error.
47type HTTPError struct {

Callers 1

newErrorFunction · 0.85

Calls 1

NextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…