MCPcopy
hub / github.com/gogf/gf / NewWithOption

Function NewWithOption

errors/gerror/gerror_api_option.go:22–33  ·  view source on GitHub ↗

NewWithOption creates and returns a custom error with Option. It is the senior usage for creating error, which is often used internally in framework.

(option Option)

Source from the content-addressed store, hash-verified

20// NewWithOption creates and returns a custom error with Option.
21// It is the senior usage for creating error, which is often used internally in framework.
22func NewWithOption(option Option) error {
23 err := &Error{
24 error: option.Error,
25 text: option.Text,
26 args: option.Args,
27 code: option.Code,
28 }
29 if option.Stack {
30 err.stack = callers()
31 }
32 return err
33}
34
35// NewOption creates and returns a custom error with Option.
36//

Callers 5

gsession.goFile · 0.92
Test_NewOptionFunction · 0.92
ghttp.goFile · 0.92
newValidationErrorFunction · 0.92
NewOptionFunction · 0.85

Calls 1

callersFunction · 0.85

Tested by 1

Test_NewOptionFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…