MCPcopy
hub / github.com/duke-git/lancet / Format

Method Format

xerror/xerror.go:98–112  ·  view source on GitHub ↗

Format returns: - %v, %s, %q: formatted message - %+v: formatted message with stack trace

(s fmt.State, verb rune)

Source from the content-addressed store, hash-verified

96// - %v, %s, %q: formatted message
97// - %+v: formatted message with stack trace
98func (e *XError) Format(s fmt.State, verb rune) {
99 switch verb {
100 case 'v':
101 if s.Flag('+') {
102 _, _ = io.WriteString(s, e.Error())
103 e.stack.Format(s, verb)
104 return
105 }
106 fallthrough
107 case 's':
108 _, _ = io.WriteString(s, e.Error())
109 case 'q':
110 fmt.Fprintf(s, "%q", e.Error())
111 }
112}
113
114// Wrap creates a new XError and copy message and id to new one.
115func (e *XError) Wrap(cause error) *XError {

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.95

Tested by

no test coverage detected