{"record":{"id":"5fdc525f4fabc2e0","repo":"toeverything/AFFiNE","slug":"failed-to-parse-google-drive-path-url","errorCode":null,"errorMessage":"Failed to parse Google Drive path URL:","messagePattern":"Failed to parse Google Drive path URL:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"blocksuite/affine/blocks/embed/src/embed-iframe-block/configs/providers/google-drive.ts","lineNumber":192,"sourceCode":"\n    // Should have at least 2 segments\n    if (pathSegments.length < 2) {\n      return undefined;\n    }\n\n    // Handle file URL: /file/d/file-id/view\n    if (isValidGoogleDriveFileUrl(parsedUrl)) {\n      return buildGoogleDriveFileEmbedUrl(pathSegments[2]);\n    }\n\n    // Handle folder URL: /drive/folders/folder-id\n    if (isValidGoogleDriveFolderUrl(parsedUrl)) {\n      return buildGoogleDriveFolderEmbedUrl(pathSegments[2]);\n    }\n\n    return undefined;\n  } catch (e) {\n    console.warn('Failed to parse Google Drive path URL:', e);\n    return undefined;\n  }\n}\n\nexport const googleDriveConfig = {\n  name: 'google-drive',\n  match: (url: string) => isValidGoogleDriveUrl(url),\n  buildOEmbedUrl: (url: string) => {\n    if (!isValidGoogleDriveUrl(url)) {\n      return undefined;\n    }\n\n    // If is a valid google drive url, build the embed url\n    return buildGoogleDriveEmbedUrl(url);\n  },\n  useOEmbedUrlDirectly: true,\n  validateIframeUrl: (iframeUrl: string) =>\n    isValidGoogleDriveIframeUrl(iframeUrl),","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/blocksuite/affine/blocks/embed/src/embed-iframe-block/configs/providers/google-drive.ts#L174-L210","documentation":"Warning logged in `buildGoogleDriveEmbedUrl` when constructing the embed URL fails — usually `new URL(url)` throwing on a malformed path URL, or a URL shape that matches no supported Google Drive pattern. Returns undefined so the URL is not converted into a Google Drive iframe embed.","triggerScenarios":"Triggered when parsing a Google Drive path URL fails with an exception inside the try block, so buildGoogleDriveEmbedUrl returns undefined instead of an embed URL.","commonSituations":"Occurs when a user pastes a malformed or nonstandard Google Drive link into the embed iframe block. Use a standard file or folder share URL from Google Drive.","solutions":["Use a standard Google Drive file URL.","Re-copy the link from Google Drive."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}