MCPcopy Create free account
hub / github.com/devfeel/dotweb / CatchError

Function CatchError

framework/exception/exception.go:10–15  ·  view source on GitHub ↗

CatchError is the unified exception handler

(title string, logtarget string, err interface{})

Source from the content-addressed store, hash-verified

8
9// CatchError is the unified exception handler
10func CatchError(title string, logtarget string, err interface{}) (errmsg string) {
11 errmsg = fmt.Sprintln(err)
12 stack := string(debug.Stack())
13 os.Stdout.Write([]byte(title + " error! => " + errmsg + " => " + stack))
14 return title + " error! => " + errmsg + " => " + stack
15}

Callers 3

wrapRouterHandleMethod · 0.92
wrapWebSocketHandleMethod · 0.92
initPluginsMethod · 0.92

Calls 1

WriteMethod · 0.65

Tested by

no test coverage detected