MCPcopy Index your code
hub / github.com/helm/helm / cleanupParseError

Function cleanupParseError

pkg/engine/engine.go:318–330  ·  view source on GitHub ↗
(filename string, err error)

Source from the content-addressed store, hash-verified

316}
317
318func cleanupParseError(filename string, err error) error {
319 tokens := strings.Split(err.Error(), ": ")
320 if len(tokens) == 1 {
321 // This might happen if a non-templating error occurs
322 return fmt.Errorf("parse error in (%s): %w", filename, err)
323 }
324 // The first token is "template"
325 // The second token is either "filename:lineno" or "filename:lineNo:columnNo"
326 location := tokens[1]
327 // The remaining tokens make up a stacktrace-like chain, ending with the relevant error
328 errMsg := tokens[len(tokens)-1]
329 return fmt.Errorf("parse error at (%s): %s", location, errMsg)
330}
331
332type TraceableError struct {
333 location string

Callers 1

renderMethod · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…