{"id":"9e21563399b8b87f","repo":"jackc/pgx","slug":"invalid-net-ipnet","errorCode":null,"errorMessage":"invalid net.IPNet","messagePattern":"invalid net\\.IPNet","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/builtin_wrappers.go","lineNumber":534,"sourceCode":"type netIPNetWrapper net.IPNet\n\nfunc (w *netIPNetWrapper) ScanNetipPrefix(v netip.Prefix) error {\n\tif !v.IsValid() {\n\t\treturn fmt.Errorf(\"cannot scan NULL into *net.IPNet\")\n\t}\n\n\t*w = netIPNetWrapper{\n\t\tIP:   v.Addr().AsSlice(),\n\t\tMask: net.CIDRMask(v.Bits(), v.Addr().BitLen()),\n\t}\n\n\treturn nil\n}\n\nfunc (w netIPNetWrapper) NetipPrefixValue() (netip.Prefix, error) {\n\tip, ok := netip.AddrFromSlice(w.IP)\n\tif !ok {\n\t\treturn netip.Prefix{}, errors.New(\"invalid net.IPNet\")\n\t}\n\n\tones, _ := w.Mask.Size()\n\n\treturn netip.PrefixFrom(ip, ones), nil\n}\n\ntype netIPWrapper net.IP\n\nfunc (w netIPWrapper) SkipUnderlyingTypePlan() {}\n\nfunc (w *netIPWrapper) ScanNetipPrefix(v netip.Prefix) error {\n\tif !v.IsValid() {\n\t\t*w = nil\n\t\treturn nil\n\t}\n\n\tif v.Addr().BitLen() != v.Bits() {","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/builtin_wrappers.go#L516-L552","documentation":"Error \"invalid net.IPNet\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/builtin_wrappers.go:534 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}