pot-app/pot-desktop · error · Error
Get Status Error: ${JSON.stringify(result)}
Error message
Get Status Error: ${JSON.stringify(result)} What it means
Fallback error in status(): the HTTP response was not ok AND the error body contained no `message` field, so the raw response body is stringified into `Get Status Error: <JSON>`. It means the QR-status poll failed with an unrecognizable error response.
Source
Thrown at src/window/Config/pages/Backup/utils/aliyun.jsx:135
}
}
export async function status(sid) {
const res = await fetch(`https://openapi.alipan.com/oauth/qrcode/${sid}/status`);
if (res.ok) {
const result = res.data;
if (result['status']) {
return { status: result['status'], code: result['authCode'] };
} else {
throw new Error(`Can not find status: ${JSON.stringify(result)}`);
}
} else {
const result = res.data;
if (result['message']) {
throw new Error(result['message']);
} else {
throw new Error(`Get Status Error: ${JSON.stringify(result)}`);
}
}
}
export async function userInfo(token) {
const res = await fetch('https://openapi.alipan.com/oauth/users/info', {
headers: {
Authorization: `Bearer ${token}`,
},
});
if (res.ok) {
const result = res.data;
if (result.hasOwnProperty('avatar') && result.hasOwnProperty('name')) {
return { avatar: result['avatar'], name: result['name'] };
} else {
throw new Error(`Can not find avatar or name: ${JSON.stringify(result)}`);
}
} else {View on GitHub (pinned to 594d32ede9)
Solutions
- Inspect the stringified body in the error to identify the responder (gateway vs API).
- Retry with backoff; transient 5xx/gateway errors usually clear.
- Regenerate the QR session via qrcode() and retry the login flow.
- Check network/proxy/firewall access to openapi.alipan.com from the app environment.
Example fix
// before
throw new Error(`Get Status Error: ${JSON.stringify(result)}`);
// after
console.error('status poll failed', res.status, result);
await new Promise((r) => setTimeout(r, 2000)); // backoff
return status(sid); // or regenerate sid via qrcode() if 4xx Defensive patterns
Strategy: retry
Validate before calling
// preflight connectivity check before polling
const ok = await fetch(`https://openapi.alipan.com/oauth/qrcode/${encodeURIComponent(sid)}/status`)
.then(r => r.ok).catch(() => false);
if (!ok) await waitForNetwork(); Type guard
function isGatewayError(result) {
return typeof result === 'string' && result.trim().startsWith('<'); // HTML page, not JSON
} Try / catch
try {
const { status } = await status(sid);
} catch (e) {
if (String(e.message).startsWith('Get Status Error')) {
// opaque non-2xx: backoff and retry, or new session after N failures
await sleep(2000 * attempt);
if (attempt < 3) return status(sid);
restartQrLogin();
}
} Prevention
- Poll with exponential backoff instead of fixed intervals
- Cap retries and regenerate the QR session after repeated opaque failures
- Check proxy/firewall access to openapi.alipan.com in restricted environments
- Include the HTTP status in logs alongside the stringified body
When it happens
Trigger: Calling status(sid) when the endpoint returns a non-2xx response whose res.data has no `message` key — e.g. HTML error page from a gateway, empty body, or differently-shaped error JSON.
Common situations: Alipan outage or CDN/WAF block returning HTML; network middleware altering responses; rate limiting with non-JSON bodies; sid containing characters that broke the URL so a gateway returned an error page.
Related errors
- Get QrCode Error: ${JSON.stringify(result)}
- Get UserInfo Error: ${JSON.stringify(result)}
- Can not find status: ${JSON.stringify(result)}
- Can not find avatar or name: ${JSON.stringify(result)}
- Can not find access_token: ${JSON.stringify(result)}
AI-assisted analysis of pot-app/pot-desktop@594d32ede9 (2026-09-02).
Data as JSON: /api/errors/7d71e382e0b483c5.
Report an issue: GitHub.