{"record":{"id":"dfeba8309522f33c","repo":"beeradmoore/dlss-swapper","slug":"could-not-find-any-gogcatalogproduct-for-url-url","errorCode":null,"errorMessage":"Could not find any GOGCatalogProduct for url, {url}","messagePattern":"Could not find any GOGCatalogProduct for url, (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Data/GOG/GOGGame.cs","lineNumber":83,"sourceCode":"\n        try\n        {\n            var url = \"https://catalog.gog.com/v1/catalog?order=desc:score&productType=in:game&query=like:\" + Uri.EscapeDataString(Title);\n            var fileDownloader = new FileDownloader(url);\n            using (var memoryStream = new MemoryStream())\n            {\n                await fileDownloader.DownloadFileToStreamAsync(memoryStream);\n                memoryStream.Position = 0;\n\n                var catalogResponse = JsonSerializer.Deserialize(memoryStream, SourceGenerationContext.Default.GOGCatalogResponse);\n                if (catalogResponse is null)\n                {\n                    throw new Exception($\"Could not deserialize GOGCatalogResponse for url, {url}\");\n                }\n\n                if (catalogResponse.Products.Length == 0)\n                {\n                    throw new Exception($\"Could not find any GOGCatalogProduct for url, {url}\");\n                }\n\n                foreach (var product in catalogResponse.Products)\n                {\n                    if (product.Id.Equals(PlatformId, StringComparison.OrdinalIgnoreCase) == false)\n                    {\n                        continue;\n                    }\n\n                    if (string.IsNullOrWhiteSpace(product.CoverVertical) == false)\n                    {\n                        await DownloadCoverAsync(product.CoverVertical).ConfigureAwait(false);\n                        return;\n                    }\n                }\n            }\n        }\n        catch (Exception err)","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/beeradmoore/dlss-swapper/blob/ab9b1e2d4bb04187c48fe58eeea06c2b0ea71fbb/src/Data/GOG/GOGGame.cs#L65-L101","documentation":"After successfully deserializing the GOG catalog response, UpdateCacheImageAsync requires at least one product entry; an empty Products array throws this error. It means GOG's catalog recognized the URL but returned no matching product data, so no cache image can be resolved.","triggerScenarios":"Calling UpdateCacheImageAsync for a game whose catalog lookup yields Products.Length == 0 — e.g. an incorrect PlatformId, a delisted/unreleased game, or querying the wrong regional catalog URL.","commonSituations":"Game removed from GOG storefront; typo or stale PlatformId after GOG restructured ids; game available in another region only; new game not yet indexed by the catalog endpoint.","solutions":["Verify PlatformId against the game's actual GOG product id","Check the game page URL resolves on GOG (delisted games return empty products)","Retry later if the game was recently added and not yet indexed","Skip cache-image update gracefully when products are empty"],"exampleFix":"// before\nif (catalogResponse.Products.Length == 0)\n{\n    throw new Exception($\"Could not find any GOGCatalogProduct for url, {url}\");\n}\n// after\nif (catalogResponse.Products.Length == 0)\n{\n    return; // no image available; log and skip instead of throwing\n}","handlingStrategy":"fallback","validationCode":"// preflight: confirm the product exists before image update\nusing var probe = await httpClient.GetAsync(url);\nvar json = await probe.Content.ReadAsStringAsync();\nif (string.IsNullOrWhiteSpace(json) || !json.Contains(\"products\", StringComparison.OrdinalIgnoreCase))\n    return; // skip, game not in catalog","typeGuard":"bool HasProducts(GOGCatalogResponse r) => r.Products.Length > 0;","tryCatchPattern":"try\n{\n    await gogGame.UpdateCacheImageAsync();\n}\ncatch (Exception ex) when (ex.Message.Contains(\"Could not find any GOGCatalogProduct\"))\n{\n    logger.LogInformation(\"No GOG product for {Url}; keeping existing cache image.\", url);\n}","preventionTips":["Validate PlatformId against GOG product pages","Skip image updates for delisted/unreleased games","Keep a previously cached image as fallback","Query the correct regional catalog endpoint"],"tags":["gog","api","empty-response"],"backgroundTag":"empty-result-set","analyzedSha":"ab9b1e2d4bb04187c48fe58eeea06c2b0ea71fbb","analyzedAt":"2026-09-15T05:25:32.979Z","contentChangedAt":"2026-09-15T05:25:32.979Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}