MCPcopy Index your code
hub / github.com/coder/coder / Format

Method Format

cli/root.go:1320–1326  ·  view source on GitHub ↗

Format formats the error to the writer in PrettyErrorFormatter. This error should be human readable.

(err error)

Source from the content-addressed store, hash-verified

1318// Format formats the error to the writer in PrettyErrorFormatter.
1319// This error should be human readable.
1320func (p *PrettyErrorFormatter) Format(err error) {
1321 output, _ := cliHumanFormatError("", err, &formatOpts{
1322 Verbose: p.verbose,
1323 })
1324 // always trail with a newline
1325 _, _ = p.w.Write([]byte(output + "\n"))
1326}
1327
1328type formatOpts struct {
1329 Verbose bool

Callers 2

RunWithSubcommandsMethod · 0.95
TestErrorExamplesFunction · 0.95

Calls 2

cliHumanFormatErrorFunction · 0.85
WriteMethod · 0.65

Tested by 1

TestErrorExamplesFunction · 0.76