{"record":{"id":"6e6510b88c2c98d3","repo":"pot-app/pot-desktop","slug":"can-not-find-default-drive-id-json-stringify-re","errorCode":null,"errorMessage":"Can not find default_drive_id: ${JSON.stringify(result)}","messagePattern":"Can not find default_drive_id: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/window/Config/pages/Backup/utils/aliyun.jsx","lineNumber":200,"sourceCode":"        } else {\n            throw new Error(`Get accessToken Error: ${JSON.stringify(result)}`);\n        }\n    }\n}\n\nasync function driveId(token) {\n    const res = await fetch('https://openapi.alipan.com/adrive/v1.0/user/getDriveInfo', {\n        method: 'POST',\n        headers: {\n            Authorization: `Bearer ${token}`,\n        },\n    });\n    if (res.ok) {\n        const result = res.data;\n        if (result['default_drive_id']) {\n            return result['default_drive_id'];\n        } else {\n            throw new Error(`Can not find default_drive_id: ${JSON.stringify(result)}`);\n        }\n    } else {\n        const result = res.data;\n        if (result['message']) {\n            throw new Error(result['message']);\n        } else {\n            throw new Error(`Get accessToken Error: ${JSON.stringify(result)}`);\n        }\n    }\n}\n\nasync function createDir(token, drive_id) {\n    const res = await fetch('https://openapi.alipan.com/adrive/v1.0/openFile/create', {\n        method: 'POST',\n        headers: {\n            Authorization: `Bearer ${token}`,\n        },\n        body: Body.json({","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/pot-app/pot-desktop/blob/594d32ede96acd106b0256deaa8bb440ffcdff40/src/window/Config/pages/Backup/utils/aliyun.jsx#L182-L218","documentation":"driveId() called the alipan getDriveInfo API with a Bearer token; the response was HTTP-ok but its JSON body contained no default_drive_id field, meaning the API accepted the request yet returned a payload without the drive identifier (e.g. an error body delivered with 200, an expired/quota-limited token response, or an API contract change). It fires whenever the response shape does not match the expected { default_drive_id } object.","triggerScenarios":"Thrown at src/window/Config/pages/Backup/utils/aliyun.jsx:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the JSON.stringify(result) in the message to see the actual API response (likely a code/message error payload) and address the reported cause","Re-authenticate to obtain a fresh valid access token before retrying","Check that the alipan API response parsing is correct (e.g. res.data is actually the parsed JSON body)","Wrap the call site (drive_id) so the user is prompted to re-login or reconfigure the Aliyun backup integration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"594d32ede96acd106b0256deaa8bb440ffcdff40","analyzedAt":"2026-09-02T18:12:21.811Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}