{"record":{"id":"7743e8c4dcee9ab3","repo":"chatboxai/chatbox","slug":"payload-error-license-request-failed-with-st","errorCode":null,"errorMessage":"${payload.error || 'License request failed with status ${response.status}'}","messagePattern":"\\$\\{payload\\.error \\|\\| 'License request failed with status \\$\\{response\\.status\\}'\\}","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/services/native-license.ts","lineNumber":51,"sourceCode":"  const fetchFn = options.fetchFn ?? fetch\n  const response = await fetchFn(`${resolveOrigin(options.apiOrigin)}${path}`, {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json', ...options.headers },\n    body: JSON.stringify(body),\n    signal: options.signal,\n  })\n  let payload: unknown = null\n  try {\n    payload = await response.json()\n  } catch {\n    payload = null\n  }\n  if (!response.ok) {\n    const message =\n      payload && typeof payload === 'object' && 'error' in payload && typeof payload.error === 'string'\n        ? payload.error\n        : `License request failed with status ${response.status}`\n    throw new Error(message)\n  }\n  return payload\n}\n\nexport async function activateNativeLicense(\n  licenseKey: string,\n  instanceName: string,\n  options: NativeLicenseRequestOptions = {}\n): Promise<NativeLicenseActivationResult> {\n  const payload = (await postLicense('/api/license/activate', { licenseKey, instanceName }, options)) as {\n    data?: { valid?: boolean; instanceId?: string; error?: string }\n  } | null\n  const data = payload?.data\n  return {\n    valid: Boolean(data?.valid),\n    instanceId: data?.instanceId ?? '',\n    error: data?.error,\n  }","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/shared/services/native-license.ts#L33-L69","documentation":"Error \"${payload.error || 'License request failed with status ${response.status}'}\" thrown in chatboxai/chatbox.","triggerScenarios":"Thrown at src/shared/services/native-license.ts:51 when the library encounters an invalid state.","commonSituations":"Occurs in src/shared/services/native-license.ts when the license request fails; the thrown message uses the server-provided payload.error or a generic status message.","solutions":["Check the license key for typos and ensure it matches the product.","Verify network connectivity to the license server and that no proxy is intercepting the request.","Read the 'error' field from the response payload (already included in the message) for the specific rejection reason.","If the activation limit is reached, deactivate the license on another device first."],"exampleFix":"if (!response.ok) {\n  // message already contains payload.error or the status; surface it to the user\n  // and let them correct the license key or deactivate another instance\n}","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}