{"id":"c7617d98405e12d9","repo":"jackc/pgx","slug":"invalid-length-for-path-w","errorCode":null,"errorMessage":"invalid length for Path: %w","messagePattern":"invalid length for Path: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/path.go","lineNumber":186,"sourceCode":"\treturn nil\n}\n\ntype scanPlanBinaryPathToPathScanner struct{}\n\nfunc (scanPlanBinaryPathToPathScanner) Scan(src []byte, dst any) error {\n\tscanner := (dst).(PathScanner)\n\n\tif src == nil {\n\t\treturn scanner.ScanPath(Path{})\n\t}\n\n\tr := pgio.NewReader(src)\n\n\tclosed := r.Byte() == 1\n\t// Each point is two float64s.\n\tpointCount := r.Count(16)\n\tif err := r.Err(); err != nil {\n\t\treturn fmt.Errorf(\"invalid length for Path: %w\", err)\n\t}\n\n\tpoints := make([]Vec2, pointCount)\n\tfor i := range points {\n\t\tx := r.Uint64()\n\t\ty := r.Uint64()\n\t\tpoints[i] = Vec2{math.Float64frombits(x), math.Float64frombits(y)}\n\t}\n\n\tif err := r.Finish(); err != nil {\n\t\treturn fmt.Errorf(\"invalid length for Path with %d points: %w\", pointCount, err)\n\t}\n\n\treturn scanner.ScanPath(Path{\n\t\tP:      points,\n\t\tClosed: closed,\n\t\tValid:  true,\n\t})","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/path.go#L168-L204","documentation":"Error \"invalid length for Path: %w\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/path.go:186 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":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}