{"record":{"id":"5dff6fdfb104389f","repo":"XTLS/Xray-core","slug":"failed-to-get-format-of","errorCode":null,"errorMessage":"Failed to get format of ","messagePattern":"Failed to get format of ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/config.go","lineNumber":128,"sourceCode":"\tswitch v := input.(type) {\n\tcase cmdarg.Arg:\n\t\tfiles := make([]*ConfigSource, len(v))\n\t\thasProtobuf := false\n\t\tfor i, file := range v {\n\t\t\tvar f string\n\n\t\t\tif formatName == \"auto\" {\n\t\t\t\tif file != \"stdin:\" {\n\t\t\t\t\tf = GetFormat(file)\n\t\t\t\t} else {\n\t\t\t\t\tf = \"json\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tf = formatName\n\t\t\t}\n\n\t\t\tif f == \"\" {\n\t\t\t\treturn nil, errors.New(\"Failed to get format of \", file).AtWarning()\n\t\t\t}\n\n\t\t\tif f == \"protobuf\" {\n\t\t\t\thasProtobuf = true\n\t\t\t}\n\t\t\tfiles[i] = &ConfigSource{\n\t\t\t\tName:   file,\n\t\t\t\tFormat: f,\n\t\t\t}\n\t\t}\n\n\t\t// only one protobuf config file is allowed\n\t\tif hasProtobuf {\n\t\t\tif len(v) == 1 {\n\t\t\t\treturn configLoaderByName[\"protobuf\"].Loader(v)\n\t\t\t} else {\n\t\t\t\treturn nil, errors.New(\"Only one protobuf config file is allowed\").AtWarning()\n\t\t\t}","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/core/config.go#L110-L146","documentation":"Error \"Failed to get format of \" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at core/config.go:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}