MCPcopy Create free account
hub / github.com/bufbuild/buf / Error

Method Error

private/bufpkg/bufparse/errors.go:53–73  ·  view source on GitHub ↗

Error implements the error interface.

()

Source from the content-addressed store, hash-verified

51
52// Error implements the error interface.
53func (p *ParseError) Error() string {
54 if p == nil {
55 return ""
56 }
57 var builder strings.Builder
58 _, _ = builder.WriteString(`could not parse`)
59 if p.typeString != "" {
60 _, _ = builder.WriteString(` `)
61 _, _ = builder.WriteString(p.typeString)
62 }
63 if p.input != "" {
64 _, _ = builder.WriteString(` "`)
65 _, _ = builder.WriteString(p.input)
66 _, _ = builder.WriteString(`"`)
67 }
68 if p.err != nil {
69 _, _ = builder.WriteString(`: `)
70 _, _ = builder.WriteString(p.err.Error())
71 }
72 return builder.String()
73}
74
75// Unwrap returns the underlying error.
76func (p *ParseError) Unwrap() error {

Callers 14

verifyDependenciesFunction · 0.45
TestPushErrorFunction · 0.45
imagesHandlerMethod · 0.45
writeErrorMethod · 0.45
GenerateMethod · 0.45
testExpectedSubsetFunction · 0.45
TestTypesFunction · 0.45

Calls 1

StringMethod · 0.65

Tested by 12

verifyDependenciesFunction · 0.36
TestPushErrorFunction · 0.36
imagesHandlerMethod · 0.36
writeErrorMethod · 0.36
testExpectedSubsetFunction · 0.36
TestTypesFunction · 0.36
TestTypesFromMainModuleFunction · 0.36
TestBasicFunction · 0.36