{"record":{"id":"7fcbd5eba8475276","repo":"ipfs/kubo","slug":"expected-type-t-got-t","errorCode":null,"errorMessage":"expected type %T, got %T","messagePattern":"expected type %T, got %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/e/error.go","lineNumber":10,"sourceCode":"package e\n\nimport (\n\t\"fmt\"\n\t\"runtime/debug\"\n)\n\n// TypeErr returns an error with a string that explains what error was expected and what was received.\nfunc TypeErr(expected, actual any) error {\n\treturn fmt.Errorf(\"expected type %T, got %T\", expected, actual)\n}\n\n// compile time type check that HandlerError is an error\nvar _ error = New(nil)\n\n// HandlerError adds a stack trace to an error\ntype HandlerError struct {\n\tErr   error\n\tStack []byte\n}\n\n// Error makes HandlerError implement error\nfunc (err HandlerError) Error() string {\n\treturn fmt.Sprintf(\"%s in:\\n%s\", err.Err.Error(), err.Stack)\n}\n\n// New returns a new HandlerError\nfunc New(err error) HandlerError {","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/e/error.go#L1-L28","documentation":"TypeErr guard: a value received in a commands post-processing/encoder path was not of the expected Go type, so it cannot be processed safely. The message names both the expected (%T) and actual (%T) types; the fault is on the producer side (wrong value emitted by a command or plugin), not user input.","triggerScenarios":"Thrown at core/commands/e/error.go:10 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report the expected/actual type pair with the command to the kubo tracker","Update kubo; encoder mismatches are usually fixed quickly","Retry with a different --enc output format"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}