{"record":{"id":"89ea41d4e89f32b2","repo":"abpframework/abp","slug":"e-message","errorCode":null,"errorMessage":"{e.Message}","messagePattern":"\\{e\\.Message\\}","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs","lineNumber":472,"sourceCode":"    private AbpTranslateInfo GetAbpTranslateInfo(string path)\n    {\n        if (!File.Exists(path))\n        {\n            throw new CliUsageException(\n                $\"File {path} does not exist!\" +\n                Environment.NewLine + Environment.NewLine +\n                GetUsageInfo()\n            );\n        }\n\n        AbpTranslateInfo translateInfo;\n        try\n        {\n            translateInfo = JsonConvert.DeserializeObject<AbpTranslateInfo>(File.ReadAllText(path));\n        }\n        catch (Exception e)\n        {\n            throw new CliUsageException(\n                e.Message +\n                Environment.NewLine + Environment.NewLine +\n                GetUsageInfo()\n            );\n        }\n\n        return translateInfo;\n    }\n\n    private Task VerifyJsonAsync(string currentDirectory)\n    {\n        var jsonFiles = GetCultureJsonFiles(currentDirectory);\n        var hasInvalidJsonFile = false;\n        foreach (var jsonFile in jsonFiles)\n        {\n            try\n            {\n                var jsonString = File.ReadAllText(jsonFile);","sourceCodeStart":454,"sourceCodeEnd":490,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs#L454-L490","documentation":"Thrown by `GetAbpTranslateInfo` when `JsonConvert.DeserializeObject<AbpTranslateInfo>` throws while parsing `abp-translation.json`. The original exception message is wrapped and surfaced as a `CliUsageException` with usage help, so the text you see is the underlying JSON/deserialization error.","triggerScenarios":"`abp-translation.json` is syntactically invalid JSON, contains a type that does not map to `AbpTranslateInfo` (e.g. wrong property names/types), or has trailing commas / encoding issues.","commonSituations":"Hand-editing `abp-translation.json` and introducing a syntax error; merge conflict markers left in the file; file saved with a BOM or non-UTF8 encoding that breaks the parser.","solutions":["Paste the contents of `abp-translation.json` into a JSON validator to find the exact parse location.","Regenerate `abp-translation.json` with `abp translate` and re-apply your changes incrementally.","Ensure the file is saved as UTF-8 without BOM and remove any merge-conflict markers."],"exampleFix":"// before (invalid): { \"TargetCulture\": \"tr\", \"ReferenceCulture\": \"en\",, }\n// after: { \"TargetCulture\": \"tr\", \"ReferenceCulture\": \"en\", \"Resources\": [] }","handlingStrategy":"try-catch","validationCode":"static bool IsValidTranslateJson(string path)\n{\n    try\n    {\n        Newtonsoft.Json.Linq.JObject.Parse(File.ReadAllText(path));\n        Newtonsoft.Json.JsonConvert.DeserializeObject<AbpTranslateInfo>(File.ReadAllText(path));\n        return true;\n    }\n    catch { return false; }\n}\n\nif (!IsValidTranslateJson(\"abp-translation.json\"))\n    Console.Error.WriteLine(\"abp-translation.json is invalid; regenerate it.\");","typeGuard":null,"tryCatchPattern":"AbpTranslateInfo info;\ntry { info = GetAbpTranslateInfo(path); }\ncatch (CliUsageException ex)\n{\n    logger.LogError(\"Failed to parse abp-translation.json: {Underlying}\", ex.Message);\n    throw;\n}","preventionTips":["Validate `abp-translation.json` with a JSON linter before committing.","Regenerate the file via `abp translate` instead of hand-editing.","Save localization files as UTF-8 without BOM."],"tags":["cli","localization","translate","json","deserialization"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}