{"record":{"id":"f8859c4deb3da034","repo":"egametang/ET","slug":"e-message-f8859c","errorCode":null,"errorMessage":"{e.Message}","messagePattern":"\\{e\\.Message\\}","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.recast/Scripts/Core/Share/Recast/ObjImporter.cs","lineNumber":50,"sourceCode":"            return new SimpleInputGeomProvider(context.vertexPositions, context.meshFaces);\n        }\n\n        public static ObjImporterContext LoadContext(byte[] chunk)\n        {\n            ObjImporterContext context = new ObjImporterContext();\n            try\n            {\n                using StreamReader reader = new StreamReader(new MemoryStream(chunk));\n                string line;\n                while ((line = reader.ReadLine()) != null)\n                {\n                    line = line.Trim();\n                    ReadLine(line, context);\n                }\n            }\n            catch (Exception e)\n            {\n                throw new Exception(e.Message, e);\n            }\n\n            return context;\n        }\n\n\n        public static void ReadLine(string line, ObjImporterContext context)\n        {\n            if (line.StartsWith(\"v\"))\n            {\n                ReadVertex(line, context);\n            }\n            else if (line.StartsWith(\"f\"))\n            {\n                ReadFace(line, context);\n            }\n        }\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.recast/Scripts/Core/Share/Recast/ObjImporter.cs#L32-L68","documentation":"In ObjImporter, the chunk-parsing loop catches any exception thrown by ReadLine and re-throws it as a new Exception wrapping only e.Message (with the original as inner). The surfaced message is therefore the underlying parse error (e.g., invalid vector, bad face index, or a numeric parse failure). It is a generic wrapper; the real cause is in the inner exception or the message text.","triggerScenarios":"Loading an OBJ file with malformed geometry lines (bad vertex coords, invalid face indices, non-numeric tokens); feeding a non-OBJ stream to the OBJ importer.","commonSituations":"Importing artist-authored OBJs with formatting quirks; corrupted/edited OBJ files; locale-dependent float parsing issues in downstream ReadVector3f.","solutions":["Inspect the inner exception / message text to identify the offending OBJ line and fix the source file.","Validate the OBJ syntax (v/f lines) before importing.","Pre-check that the stream is actually OBJ text and not empty/binary.","Use invariant-culture parsing at the call site to avoid locale-driven float errors."],"exampleFix":"// before\nvar ctx = ObjImporter.Load(chunk); // bubbles {e.Message}\n\n// after\ntry { var ctx = ObjImporter.Load(chunk); }\ncatch (Exception ex)\n{\n    Debug.LogError($\"OBJ import failed: {ex.Message} (inner: {ex.InnerException?.Message})\");\n    // fix the offending line in the OBJ source\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check stream is non-empty text starting with a known OBJ token.\nusing var ms = new MemoryStream(chunk);\nusing var sr = new StreamReader(ms);\nstring first = sr.ReadLine() ?? \"\";\nif (!first.StartsWith(\"#\") && !first.StartsWith(\"v\") && !first.StartsWith(\"f\") && !first.StartsWith(\"o\"))\n    throw new InvalidDataException(\"Not an OBJ stream\");","typeGuard":"static bool LooksLikeObj(byte[] chunk)\n{ try { var s = System.Text.Encoding.ASCII.GetString(chunk, 0, Math.Min(64, chunk.Length)); return s.Contains(\"v \") || s.Contains(\"f \") || s.StartsWith(\"#\"); } catch { return false; } }","tryCatchPattern":"try { var ctx = ObjImporter.Load(chunk); }\ncatch (Exception e)\n{ Debug.LogError($\"OBJ parse failed: {e.Message}; inner: {e.InnerException?.Message}\"); throw; }","preventionTips":["Inspect the inner exception / message to find the offending OBJ line.","Validate OBJ syntax before importing.","Confirm float tokens are locale-independent (invariant culture).","Re-export OBJs from a reliable DCC tool."],"tags":["recast","obj-import","parsing","io"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}