{"record":{"id":"b4ee88e81f9c1837","repo":"different-ai/openwork","slug":"failed-to-load-collection-access-response-statu","errorCode":null,"errorMessage":"Failed to load collection access (${response.status}).","messagePattern":"Failed to load collection access \\((.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_components/marketplace-data.tsx","lineNumber":263,"sourceCode":"    orgWide: Boolean(entry.orgWide),\n    role,\n    createdAt: asString(entry.createdAt) ?? new Date().toISOString(),\n    removedAt: asString(entry.removedAt),\n  };\n}\n\nexport function useMarketplaceAccess(marketplaceId: string | null) {\n  return useQuery({\n    enabled: Boolean(marketplaceId),\n    queryKey: marketplaceQueryKeys.access(marketplaceId ?? \"none\"),\n    queryFn: async (): Promise<MarketplaceAccessGrant[]> => {\n      const { response, payload } = await requestJson(\n        `/v1/marketplaces/${encodeURIComponent(marketplaceId ?? \"\")}/access`,\n        { method: \"GET\" },\n        15000,\n      );\n      if (!response.ok) {\n        throw new Error(getErrorMessage(payload, `Failed to load collection access (${response.status}).`));\n      }\n\n      const items = isRecord(payload) && Array.isArray(payload.items) ? payload.items : [];\n      return items\n        .map(parseAccessGrant)\n        .filter((value): value is MarketplaceAccessGrant => Boolean(value) && value?.removedAt === null);\n    },\n  });\n}\n\nexport function useGrantMarketplaceAccess() {\n  const queryClient = useQueryClient();\n  const { runReauthableAction } = useOrgDashboard();\n\n  return useMutation({\n    mutationFn: async (input: {\n      marketplaceId: string;\n      body:","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_components/marketplace-data.tsx#L245-L281","documentation":"Error \"Failed to load collection access (${response.status}).\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/apps/den-web/app/(den)/dashboard/_components/marketplace-data.tsx:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}