{"id":"b1e023123860617a","repo":"docker/cli","slug":"template-parsing-error-w-b1e023","errorCode":null,"errorMessage":"template parsing error: %w","messagePattern":"template parsing error: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/inspect/inspector.go","lineNumber":62,"sourceCode":"}\n\n// NewTemplateInspectorFromString creates a new TemplateInspector from a string\n// which is compiled into a template.\nfunc NewTemplateInspectorFromString(out io.Writer, tmplStr string) (Inspector, error) {\n\tif out == nil {\n\t\treturn nil, errors.New(\"no output stream\")\n\t}\n\tif tmplStr == \"\" {\n\t\treturn NewIndentedInspector(out), nil\n\t}\n\n\tif tmplStr == \"json\" {\n\t\treturn NewJSONInspector(out), nil\n\t}\n\n\ttmpl, err := templates.Parse(tmplStr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"template parsing error: %w\", err)\n\t}\n\treturn NewTemplateInspector(out, tmpl), nil\n}\n\n// GetRefFunc is a function which used by Inspect to fetch an object from a\n// reference\ntype GetRefFunc func(ref string) (any, []byte, error)\n\n// Inspect fetches objects by reference using GetRefFunc and writes the json\n// representation to the output writer.\nfunc Inspect(out io.Writer, references []string, tmplStr string, getRef GetRefFunc) error {\n\tif out == nil {\n\t\treturn errors.New(\"no output stream\")\n\t}\n\tinspector, err := NewTemplateInspectorFromString(out, tmplStr)\n\tif err != nil {\n\t\treturn cli.StatusError{StatusCode: 64, Status: err.Error()}\n\t}","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/inspect/inspector.go#L44-L80","documentation":"Error \"template parsing error: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/inspect/inspector.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}