[{"data":1,"prerenderedAt":1354},["ShallowReactive",2],{"navigation_docs":3,"-sdk-errors-and-retries":223,"-sdk-errors-and-retries-surround":1349},[4,30,83,128,157,182],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","\u002Fgetting-started","1.getting-started",[9,13,17,21,25],{"title":10,"path":11,"stem":12},"What is FlashDrive?","\u002Fgetting-started\u002Fwhat-is-flashdrive","1.getting-started\u002F01.what-is-flashdrive",{"title":14,"path":15,"stem":16},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F02.quickstart",{"title":18,"path":19,"stem":20},"Key concepts","\u002Fgetting-started\u002Fkey-concepts","1.getting-started\u002F03.key-concepts",{"title":22,"path":23,"stem":24},"Find files","\u002Fgetting-started\u002Ffind-files","1.getting-started\u002F04.find-files",{"title":26,"path":27,"stem":28},"Common use cases","\u002Fgetting-started\u002Fuse-cases","1.getting-started\u002F05.use-cases",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Platform Guide","\u002Fplatform","2.platform",[35,39,43,47,51,55,59,63,67,71,75,79],{"title":36,"path":37,"stem":38},"Organizations and workspaces","\u002Fplatform\u002Forganizations-and-workspaces","2.platform\u002F01.organizations-and-workspaces",{"title":40,"path":41,"stem":42},"Members, invitations, and roles","\u002Fplatform\u002Fmembers-and-roles","2.platform\u002F02.members-and-roles",{"title":44,"path":45,"stem":46},"API keys and permissions","\u002Fplatform\u002Fapi-keys","2.platform\u002F03.api-keys",{"title":48,"path":49,"stem":50},"Drives and the default drive","\u002Fplatform\u002Fdrives-and-defaults","2.platform\u002F04.drives-and-defaults",{"title":52,"path":53,"stem":54},"Folders and files","\u002Fplatform\u002Ffolders-and-documents","2.platform\u002F05.folders-and-documents",{"title":56,"path":57,"stem":58},"Upload files","\u002Fplatform\u002Fuploads-and-indexing","2.platform\u002F06.uploads-and-processing",{"title":60,"path":61,"stem":62},"Usage","\u002Fplatform\u002Fusage","2.platform\u002F07.usage",{"title":64,"path":65,"stem":66},"Billing and credits","\u002Fplatform\u002Fbilling","2.platform\u002F08.billing",{"title":68,"path":69,"stem":70},"Storage and limits","\u002Fplatform\u002Fstorage-and-upgrades","2.platform\u002F09.storage-and-upgrades",{"title":72,"path":73,"stem":74},"Account settings and security","\u002Fplatform\u002Faccount-and-security","2.platform\u002F10.account-and-security",{"title":76,"path":77,"stem":78},"Redeem a promo code","\u002Fplatform\u002Fpromo-codes","2.platform\u002F11.promo-codes",{"title":80,"path":81,"stem":82},"Build tools from files","\u002Fplatform\u002Ffile-workflows","2.platform\u002F12.file-workflows",{"title":84,"path":85,"stem":86,"children":87,"page":29},"SDK Guide","\u002Fsdk","4.sdk",[88,92,96,100,104,108,112,116,120,124],{"title":89,"path":90,"stem":91},"Python installation and configuration","\u002Fsdk\u002Finstallation","4.sdk\u002F01.installation",{"title":93,"path":94,"stem":95},"Upload your first files","\u002Fsdk\u002Fupload-files","4.sdk\u002F02.upload-files",{"title":97,"path":98,"stem":99},"Upload a large collection","\u002Fsdk\u002Fbulk-imports","4.sdk\u002F03.bulk-imports",{"title":101,"path":102,"stem":103},"Find, read and edit files","\u002Fsdk\u002Ffiles","4.sdk\u002F05.files",{"title":105,"path":106,"stem":107},"Work with folders","\u002Fsdk\u002Ffolders","4.sdk\u002F06.folders",{"title":109,"path":110,"stem":111},"Manage drives and defaults","\u002Fsdk\u002Fdrives-and-defaults","4.sdk\u002F07.drives-and-defaults",{"title":113,"path":114,"stem":115},"Replace files and attach metadata","\u002Fsdk\u002Freplace-and-label","4.sdk\u002F08.replace-and-label",{"title":117,"path":118,"stem":119},"Upload recovery and partial failures","\u002Fsdk\u002Fupload-recovery","4.sdk\u002F09.upload-recovery",{"title":121,"path":122,"stem":123},"Async workflows","\u002Fsdk\u002Fasync","4.sdk\u002F10.async",{"title":125,"path":126,"stem":127},"Errors, timeouts, and retries","\u002Fsdk\u002Ferrors-and-retries","4.sdk\u002F11.errors-and-retries",{"title":129,"path":130,"stem":131,"children":132,"page":29},"CLI Guide","\u002Fcli","5.cli",[133,137,141,145,149,153],{"title":134,"path":135,"stem":136},"Get Started","\u002Fcli\u002Fquickstart","5.cli\u002F01.quickstart",{"title":138,"path":139,"stem":140},"Profiles and Access","\u002Fcli\u002Fconfiguration","5.cli\u002F02.configuration",{"title":142,"path":143,"stem":144},"Uploads and Recovery","\u002Fcli\u002Fuploads-and-recovery","5.cli\u002F03.uploads-and-recovery",{"title":146,"path":147,"stem":148},"Mount and Sync","\u002Fcli\u002Fmount-and-sync","5.cli\u002F05.mount-and-sync",{"title":150,"path":151,"stem":152},"Sandbox Tokens","\u002Fcli\u002Fsandboxes","5.cli\u002F06.sandboxes",{"title":154,"path":155,"stem":156},"Command Reference","\u002Fcli\u002Fcommands","5.cli\u002F07.commands",{"title":158,"path":159,"stem":160,"children":161,"page":29},"MCP","\u002Fmcp","6.mcp",[162,166,170,174,178],{"title":163,"path":164,"stem":165},"Connect an AI client","\u002Fmcp\u002Fconnect","6.mcp\u002F01.connect",{"title":167,"path":168,"stem":169},"Choose an assistant’s permissions","\u002Fmcp\u002Fpermissions","6.mcp\u002F02.permissions",{"title":171,"path":172,"stem":173},"Upload and manage content","\u002Fmcp\u002Fmanage-content","6.mcp\u002F04.manage-content",{"title":175,"path":176,"stem":177},"Tool reference","\u002Fmcp\u002Ftools","6.mcp\u002F05.tools",{"title":179,"path":180,"stem":181},"Troubleshooting and revoking access","\u002Fmcp\u002Ftroubleshooting","6.mcp\u002F06.troubleshooting",{"title":183,"path":184,"stem":185,"children":186,"page":29},"Reference","\u002Freference","7.reference",[187,191,195,199,203,207,211,215,219],{"title":188,"path":189,"stem":190},"Authentication and API conventions","\u002Freference\u002Fauthentication","7.reference\u002F01.authentication",{"title":192,"path":193,"stem":194},"Organizations, workspaces, and access API","\u002Freference\u002Faccess-api","7.reference\u002F02.access-api",{"title":196,"path":197,"stem":198},"Drives, folders, and files API","\u002Freference\u002Fcontent-api","7.reference\u002F03.content-api",{"title":200,"path":201,"stem":202},"Uploads API","\u002Freference\u002Fuploads-api","7.reference\u002F04.uploads-api",{"title":204,"path":205,"stem":206},"Usage and billing API","\u002Freference\u002Fusage-and-billing-api","7.reference\u002F06.usage-and-billing-api",{"title":208,"path":209,"stem":210},"Errors and recovery","\u002Freference\u002Ferrors","7.reference\u002F07.errors",{"title":212,"path":213,"stem":214},"Limits and supported files","\u002Freference\u002Flimits","7.reference\u002F08.limits",{"title":216,"path":217,"stem":218},"Troubleshooting","\u002Freference\u002Ftroubleshooting","7.reference\u002F09.troubleshooting",{"title":220,"path":221,"stem":222},"Changelog","\u002Freference\u002Fchangelog","7.reference\u002F10.changelog",{"id":224,"title":125,"body":225,"description":1342,"extension":1343,"links":1344,"meta":1345,"navigation":1346,"path":126,"seo":1347,"stem":127,"__hash__":1348},"docs\u002F4.sdk\u002F11.errors-and-retries.md",{"type":226,"value":227,"toc":1332},"minimark",[228,232,244,249,339,342,487,506,510,513,722,781,790,793,955,959,962,1037,1056,1060,1066,1172,1185,1189,1209,1215,1220,1233,1242,1246,1318,1328],[229,230,231],"p",{},"These examples use the latest stable release of the Python SDK.",[229,233,234,235,239,240,243],{},"Every API failure raises a ",[236,237,238],"code",{},"FlashdriveError"," or one of its subclasses. Invalid arguments are caught before anything is sent and raise ",[236,241,242],{},"ValueError",".",[245,246,248],"h2",{"id":247},"inspect-an-error","Inspect an error",[250,251,256],"pre",{"className":252,"code":253,"language":254,"meta":255,"style":255},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from flashdrive import Flashdrive, FlashdriveError\n\nwith Flashdrive(drive_id=\"DRIVE_UUID\") as client:\n    try:\n        client.files.edit_text(\n            \"DOCUMENT_UUID\",\n            [(\"draft\", \"final\")],\n            revision=\"7\",\n            idempotency_key=\"finalize-1\",\n        )\n    except FlashdriveError as exc:\n        print(exc.status, exc.code, exc.request_id, exc.details)\n        print(exc.error_type, exc.retryable, exc.retry_key, exc.retry_after)\n","python","",[236,257,258,266,273,279,285,291,297,303,309,315,321,327,333],{"__ignoreMap":255},[259,260,263],"span",{"class":261,"line":262},"line",1,[259,264,265],{},"from flashdrive import Flashdrive, FlashdriveError\n",[259,267,269],{"class":261,"line":268},2,[259,270,272],{"emptyLinePlaceholder":271},true,"\n",[259,274,276],{"class":261,"line":275},3,[259,277,278],{},"with Flashdrive(drive_id=\"DRIVE_UUID\") as client:\n",[259,280,282],{"class":261,"line":281},4,[259,283,284],{},"    try:\n",[259,286,288],{"class":261,"line":287},5,[259,289,290],{},"        client.files.edit_text(\n",[259,292,294],{"class":261,"line":293},6,[259,295,296],{},"            \"DOCUMENT_UUID\",\n",[259,298,300],{"class":261,"line":299},7,[259,301,302],{},"            [(\"draft\", \"final\")],\n",[259,304,306],{"class":261,"line":305},8,[259,307,308],{},"            revision=\"7\",\n",[259,310,312],{"class":261,"line":311},9,[259,313,314],{},"            idempotency_key=\"finalize-1\",\n",[259,316,318],{"class":261,"line":317},10,[259,319,320],{},"        )\n",[259,322,324],{"class":261,"line":323},11,[259,325,326],{},"    except FlashdriveError as exc:\n",[259,328,330],{"class":261,"line":329},12,[259,331,332],{},"        print(exc.status, exc.code, exc.request_id, exc.details)\n",[259,334,336],{"class":261,"line":335},13,[259,337,338],{},"        print(exc.error_type, exc.retryable, exc.retry_key, exc.retry_after)\n",[229,340,341],{},"Every error has:",[343,344,345,358],"table",{},[346,347,348],"thead",{},[349,350,351,355],"tr",{},[352,353,354],"th",{},"Attribute",[352,356,357],{},"Meaning",[359,360,361,376,393,407,417,427,440,467],"tbody",{},[349,362,363,369],{},[364,365,366],"td",{},[236,367,368],{},"status",[364,370,371,372,375],{},"The HTTP status, or ",[236,373,374],{},"None"," for a failure inside the SDK.",[349,377,378,382],{},[364,379,380],{},[236,381,236],{},[364,383,384,385,388,389,392],{},"A stable code such as ",[236,386,387],{},"stale_version"," or ",[236,390,391],{},"drive_limit_exceeded",". Decide on this, not on the message, whose wording can change.",[349,394,395,400],{},[364,396,397],{},[236,398,399],{},"request_id",[364,401,402,403,243],{},"Quote it when you contact ",[404,405,406],"a",{"href":217},"support",[349,408,409,414],{},[364,410,411],{},[236,412,413],{},"details",[364,415,416],{},"More about the failure, such as the field or the index of a failed edit.",[349,418,419,424],{},[364,420,421],{},[236,422,423],{},"retry_after",[364,425,426],{},"Seconds to wait before retrying, when the service says.",[349,428,429,434],{},[364,430,431],{},[236,432,433],{},"error_type",[364,435,436,437,243],{},"The kind of problem, an ",[236,438,439],{},"ErrorType",[349,441,442,447],{},[364,443,444],{},[236,445,446],{},"retryable",[364,448,449,450,453,454,457,458,457,461,388,464,243],{},"A ",[236,451,452],{},"Retryable",": ",[236,455,456],{},"never",", ",[236,459,460],{},"after_backoff",[236,462,463],{},"after_retry_after",[236,465,466],{},"after_change",[349,468,469,474],{},[364,470,471],{},[236,472,473],{},"retry_key",[364,475,449,476,453,479,482,483,486],{},[236,477,478],{},"RetryKey",[236,480,481],{},"same"," to retry with the same idempotency key, ",[236,484,485],{},"new"," for a new one.",[229,488,489,490,493,494,497,498,501,502,505],{},"Three properties sum these up: ",[236,491,492],{},"is_retryable"," (sending the request again can ever succeed), ",[236,495,496],{},"retry_unchanged"," (the same request can simply be sent again after a wait) and ",[236,499,500],{},"retry_with_same_key",". The advice comes from the service's answer, then from the SDK's own list of codes, then from the HTTP status, so even a code newer than your SDK carries advice. Values the SDK does not know stay as the strings the service sent. See the ",[404,503,504],{"href":209},"error reference"," for codes and messages.",[245,507,509],{"id":508},"handle-a-kind-of-problem","Handle a kind of problem",[229,511,512],{},"Each kind of error has its own class, so you can handle a kind of problem without knowing every code:",[343,514,515,529],{},[346,516,517],{},[349,518,519,522,526],{},[352,520,521],{},"Class",[352,523,524],{},[236,525,433],{},[352,527,528],{},"Typical cause",[359,530,531,550,565,580,595,610,627,642,657,677,692,707],{},[349,532,533,538,543],{},[364,534,535],{},[236,536,537],{},"AuthenticationError",[364,539,540],{},[236,541,542],{},"auth",[364,544,545,546,549],{},"A missing, wrong or revoked key (",[236,547,548],{},"invalid_credentials",").",[349,551,552,557,562],{},[364,553,554],{},[236,555,556],{},"PermissionDeniedError",[364,558,559],{},[236,560,561],{},"permission",[364,563,564],{},"The key or token may not do this.",[349,566,567,572,577],{},[364,568,569],{},[236,570,571],{},"NotFoundError",[364,573,574],{},[236,575,576],{},"not_found",[364,578,579],{},"The drive, folder or file does not exist, or is outside your access.",[349,581,582,587,592],{},[364,583,584],{},[236,585,586],{},"InvalidRequestError",[364,588,589],{},[236,590,591],{},"invalid",[364,593,594],{},"A value the service refused.",[349,596,597,602,607],{},[364,598,599],{},[236,600,601],{},"ConflictError",[364,603,604],{},[236,605,606],{},"conflict",[364,608,609],{},"A name taken, an edit that does not apply, or work still in progress.",[349,611,612,617,622],{},[364,613,614],{},[236,615,616],{},"PreconditionFailedError",[364,618,619],{},[236,620,621],{},"precondition",[364,623,624,625,549],{},"The file changed since you read it (",[236,626,387],{},[349,628,629,634,639],{},[364,630,631],{},[236,632,633],{},"RateLimitError",[364,635,636],{},[236,637,638],{},"rate_limit",[364,640,641],{},"Too many requests, or the drive's upload capacity is full.",[349,643,644,649,654],{},[364,645,646],{},[236,647,648],{},"PaymentRequiredError",[364,650,651],{},[236,652,653],{},"payment_required",[364,655,656],{},"The workspace's plan or balance needs attention.",[349,658,659,664,669],{},[364,660,661],{},[236,662,663],{},"QuotaExceededError",[364,665,666],{},[236,667,668],{},"quota",[364,670,671,672,457,674,549],{},"A drive or storage limit (",[236,673,391],{},[236,675,676],{},"storage_capacity_exceeded",[349,678,679,684,689],{},[364,680,681],{},[236,682,683],{},"RequestTooLargeError",[364,685,686],{},[236,687,688],{},"too_large",[364,690,691],{},"A file or request over its size limit.",[349,693,694,699,704],{},[364,695,696],{},[236,697,698],{},"ServiceUnavailableError",[364,700,701],{},[236,702,703],{},"unavailable",[364,705,706],{},"The service is busy or briefly unavailable.",[349,708,709,714,719],{},[364,710,711],{},[236,712,713],{},"UpgradeRequiredError",[364,715,716],{},[236,717,718],{},"upgrade",[364,720,721],{},"This SDK version or API version is not supported.",[250,723,725],{"className":252,"code":724,"language":254,"meta":255,"style":255},"import time\nfrom flashdrive import ConflictError, PreconditionFailedError, RateLimitError\n\ntry:\n    client.files.write_bytes(document_id, data, revision=revision, offset=0)\nexcept PreconditionFailedError:\n    ...  # the file changed: read it again, then decide\nexcept ConflictError as exc:\n    ...  # look at exc.code\nexcept RateLimitError as exc:\n    time.sleep(exc.retry_after or 1)\n",[236,726,727,732,737,741,746,751,756,761,766,771,776],{"__ignoreMap":255},[259,728,729],{"class":261,"line":262},[259,730,731],{},"import time\n",[259,733,734],{"class":261,"line":268},[259,735,736],{},"from flashdrive import ConflictError, PreconditionFailedError, RateLimitError\n",[259,738,739],{"class":261,"line":275},[259,740,272],{"emptyLinePlaceholder":271},[259,742,743],{"class":261,"line":281},[259,744,745],{},"try:\n",[259,747,748],{"class":261,"line":287},[259,749,750],{},"    client.files.write_bytes(document_id, data, revision=revision, offset=0)\n",[259,752,753],{"class":261,"line":293},[259,754,755],{},"except PreconditionFailedError:\n",[259,757,758],{"class":261,"line":299},[259,759,760],{},"    ...  # the file changed: read it again, then decide\n",[259,762,763],{"class":261,"line":305},[259,764,765],{},"except ConflictError as exc:\n",[259,767,768],{"class":261,"line":311},[259,769,770],{},"    ...  # look at exc.code\n",[259,772,773],{"class":261,"line":317},[259,774,775],{},"except RateLimitError as exc:\n",[259,777,778],{"class":261,"line":323},[259,779,780],{},"    time.sleep(exc.retry_after or 1)\n",[229,782,783,784,786,787],{},"A throttled request raises ",[236,785,633],{}," with the message ",[236,788,789],{},"Too many requests. Try again after HH:MM UTC.",[229,791,792],{},"Other errors the SDK raises itself:",[343,794,795,805],{},[346,796,797],{},[349,798,799,802],{},[352,800,801],{},"Error",[352,803,804],{},"When",[359,806,807,825,839,857,873,905,922,945],{},[349,808,809,819],{},[364,810,811,814,815,818],{},[236,812,813],{},"SDKTimeoutError"," (code ",[236,816,817],{},"sdk_timeout",")",[364,820,821,822,243],{},"A call ran out of its ",[236,823,824],{},"timeout",[349,826,827,832],{},[364,828,829],{},[236,830,831],{},"UploadError",[364,833,834,835,838],{},"An upload failed after the service accepted it; ",[236,836,837],{},"receipt"," holds what to resume.",[349,840,841,849],{},[364,842,843,814,846,818],{},[236,844,845],{},"UploadTimeoutError",[236,847,848],{},"upload_timeout",[364,850,851,852,854,855,243],{},"An upload's local wait ran out; it is both an ",[236,853,831],{}," and an ",[236,856,813],{},[349,858,859,867],{},[364,860,861,814,864,818],{},[236,862,863],{},"UploadBatchError",[236,865,866],{},"upload_batch_failed",[364,868,869,870,243],{},"Some files of an upload failed; see ",[404,871,872],{"href":118},"upload recovery",[349,874,875,880],{},[364,876,877],{},[236,878,879],{},"FileEditError",[364,881,449,882,885,886,457,889,457,892,457,895,898,899,901,902,904],{},[236,883,884],{},"files.write_bytes()"," call stopped. ",[236,887,888],{},"idempotency_key",[236,890,891],{},"drive_id",[236,893,894],{},"document_id",[236,896,897],{},"base_revision"," and ",[236,900,837],{}," say how to resume: send the same data, options and revision with that key. A pending ",[236,903,837],{}," does not prove the edit was saved.",[349,906,907,912],{},[364,908,909],{},[236,910,911],{},"FileEditTimeoutError",[364,913,449,914,916,917,854,919,921],{},[236,915,884],{}," time limit ran out and the outcome is unknown; it is both a ",[236,918,879],{},[236,920,813],{},". Resume as above.",[349,923,924,929],{},[364,925,926],{},[236,927,928],{},"BulkImportError",[364,930,931,932,457,935,898,937,940,941,944],{},"A bulk import stopped. ",[236,933,934],{},"import_id",[236,936,891],{},[236,938,939],{},"journal"," say how to resume, and ",[236,942,943],{},"import_status"," holds the last status, if known.",[349,946,947,952],{},[364,948,949],{},[236,950,951],{},"SDKCompatibilityError",[364,953,954],{},"This SDK cannot work with the service's API.",[245,956,958],{"id":957},"keep-the-sdk-up-to-date","Keep the SDK up to date",[229,960,961],{},"Two errors ask you to change your installed client or your code:",[343,963,964,976],{},[346,965,966],{},[349,967,968,970,973],{},[352,969,801],{},[352,971,972],{},"HTTP status and code",[352,974,975],{},"What to do",[359,977,978,1007],{},[349,979,980,985,991],{},[364,981,982],{},[236,983,984],{},"ClientUpgradeRequiredError",[364,986,987,988],{},"426 ",[236,989,990],{},"client_upgrade_required",[364,992,993,994,997,998,898,1001,1004,1005,243],{},"This SDK version is below the oldest one the service supports. Check the available matching release in ",[404,995,996],{"href":90},"SDK setup"," before upgrading. ",[236,999,1000],{},"exc.minimum_version",[236,1002,1003],{},"exc.latest_version"," name the oldest supported and newest releases. It is an ",[236,1006,951],{},[349,1008,1009,1014,1020],{},[364,1010,1011],{},[236,1012,1013],{},"APIVersionRetiredError",[364,1015,1016,1017],{},"410 ",[236,1018,1019],{},"api_version_retired",[364,1021,1022,1023,1026,1027,1030,1031,1033,1034,243],{},"The endpoint was retired on ",[236,1024,1025],{},"exc.sunset_at",". Switch to ",[236,1028,1029],{},"exc.replacement",", which can be ",[236,1032,374],{},", and read the guide at ",[236,1035,1036],{},"exc.docs_url",[229,1038,1039,1040,1043,1044,1047,1048,1051,1052,1055],{},"Before that happens, the SDK warns you once per notice and process: ",[236,1041,1042],{},"SDKUpgradeWarning"," when a newer release is available and ",[236,1045,1046],{},"SDKDeprecationWarning"," when something you use is deprecated, with the replacement, retirement date and upgrade command. Control them with Python's warning filters, or pass ",[236,1049,1050],{},"version_warnings=False"," to the client. The notices stay available in ",[236,1053,1054],{},"client.notices",". The SDK never upgrades itself.",[245,1057,1059],{"id":1058},"choose-a-time-budget","Choose a time budget",[229,1061,1062,1063,1065],{},"Every call takes ",[236,1064,824],{},", in seconds, for the whole call including retries:",[343,1067,1068,1080],{},[346,1069,1070],{},[349,1071,1072,1075],{},[352,1073,1074],{},"Call",[352,1076,1077,1078],{},"Default ",[236,1079,824],{},[359,1081,1082,1090,1104,1121,1131,1143,1153,1163],{},[349,1083,1084,1087],{},[364,1085,1086],{},"Most calls",[364,1088,1089],{},"30",[349,1091,1092,1097],{},[364,1093,1094],{},[236,1095,1096],{},"upload()",[364,1098,1099,1100,1103],{},"600 for the transfers, plus ",[236,1101,1102],{},"processing_timeout"," 600 for processing",[349,1105,1106,1118],{},[364,1107,1108,457,1111,1114,1115],{},[236,1109,1110],{},"documents.replace_file()",[236,1112,1113],{},"uploads.resume()",", recursive ",[236,1116,1117],{},"folders.delete()",[364,1119,1120],{},"600",[349,1122,1123,1128],{},[364,1124,1125],{},[236,1126,1127],{},"files.edit_text()",[364,1129,1130],{},"120",[349,1132,1133,1137],{},[364,1134,1135],{},[236,1136,884],{},[364,1138,1139,1140,1142],{},"120 per request, ",[236,1141,1102],{}," 3600 overall",[349,1144,1145,1150],{},[364,1146,1147],{},[236,1148,1149],{},"files.download()",[364,1151,1152],{},"120 for each range request",[349,1154,1155,1160],{},[364,1156,1157],{},[236,1158,1159],{},"files.read_bytes()",[364,1161,1162],{},"60",[349,1164,1165,1170],{},[364,1166,1167],{},[236,1168,1169],{},"folders.ensure()",[364,1171,1162],{},[229,1173,1174,1175,1178,1179,898,1181,1184],{},"Use ",[236,1176,1177],{},"wait=False"," on ",[236,1180,1096],{},[236,1182,1183],{},"replace_file()"," to return once the service has accepted the work. Closing network connections can take a moment longer than the time limit. After a local timeout, use the original key or upload receipt to recover the result: work the service accepted continues.",[245,1186,1188],{"id":1187},"automatic-retries","Automatic retries",[229,1190,1191,1192,1194,1195,1198,1199,1202,1203,1205,1206,243],{},"The SDK retries a request only when repeating it is safe: reads, and changes that carry an idempotency key. It makes up to three attempts within the call's ",[236,1193,824],{}," for HTTP 429, 502, 503 and 504, for ",[236,1196,1197],{},"request_in_progress",", and for dropped connections, waiting at least the ",[236,1200,1201],{},"Retry-After"," the service sends. If the wait a 429 asks for would outlast the deadline, the SDK raises the ",[236,1204,633],{}," at once. After the last attempt, a dropped connection raises an error with code ",[236,1207,1208],{},"transport_error",[229,1210,1211,1212,1214],{},"Calls that change files make their own idempotency key when you do not pass one, so the SDK's retries never apply a change twice. Pass your own ",[236,1213,888],{}," when you want to retry the same change yourself, for example after your process restarts. A key is 1 to 128 visible ASCII characters.",[1216,1217,1219],"h3",{"id":1218},"wait-for-upload-capacity","Wait for upload capacity",[229,1221,1222,1223,1226,1227,1229,1230,1232],{},"When a drive's upload capacity is full, the service answers 429 ",[236,1224,1225],{},"upload_limit"," or 409 ",[236,1228,1197],{},". For uploads, the SDK waits and retries with the same key until the transfer deadline, following ",[236,1231,1201],{}," and adding a small random delay to spread out clients. These waits do not use up the three attempts. Files waiting for capacity do not stop the rest of a batch.",[229,1234,1235,1236,1238,1239,243],{},"For ",[236,1237,676],{},", free space or increase your workspace's storage before retrying; see ",[404,1240,1241],{"href":69},"storage and upgrades",[245,1243,1245],{"id":1244},"decide-whether-to-reuse-the-key","Decide whether to reuse the key",[343,1247,1248,1258],{},[346,1249,1250],{},[349,1251,1252,1255],{},[352,1253,1254],{},"Outcome",[352,1256,1257],{},"Next step",[359,1259,1260,1268,1278,1289,1299,1307],{},[349,1261,1262,1265],{},[364,1263,1264],{},"The connection dropped before a reply arrived",[364,1266,1267],{},"Retry the unchanged request with the same key to get the original result.",[349,1269,1270,1275],{},[364,1271,1272,1273,818],{},"The request is still running (",[236,1274,1197],{},[364,1276,1277],{},"Wait, then retry with the same key.",[349,1279,1280,1283],{},[364,1281,1282],{},"Rate limited",[364,1284,1285,1286,1288],{},"Wait for ",[236,1287,423],{}," and retry with the same key.",[349,1290,1291,1296],{},[364,1292,1293,1294,818],{},"The file changed (",[236,1295,387],{},[364,1297,1298],{},"Read it again, redo the change if it still applies, and use a new key.",[349,1300,1301,1304],{},[364,1302,1303],{},"The service refused the input",[364,1305,1306],{},"Correct it and use a new key for the changed request.",[349,1308,1309,1315],{},[364,1310,1311,1312,818],{},"The key was used with different details (",[236,1313,1314],{},"idempotency_conflict",[364,1316,1317],{},"Send the original details, or use a new key.",[229,1319,1320,1323,1324,388,1326,243],{},[236,1321,1322],{},"exc.retry_key"," gives the same advice for any error: ",[236,1325,481],{},[236,1327,485],{},[1329,1330,1331],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":255,"searchDepth":268,"depth":268,"links":1333},[1334,1335,1336,1337,1338,1341],{"id":247,"depth":268,"text":248},{"id":508,"depth":268,"text":509},{"id":957,"depth":268,"text":958},{"id":1058,"depth":268,"text":1059},{"id":1187,"depth":268,"text":1188,"children":1339},[1340],{"id":1218,"depth":275,"text":1219},{"id":1244,"depth":268,"text":1245},"Handle errors by kind, choose time limits, and retry requests safely.","md",null,{},{"title":125},{"title":125,"description":1342},"bTWghXN2JuxKog0xtVSOrwYFNenaM50v4Gpw7bkpAGM",[1350,1352],{"title":121,"path":122,"stem":123,"description":1351,"children":-1},"Upload, read and edit files with the asynchronous client.",{"title":134,"path":135,"stem":136,"description":1353,"children":-1},"Install the flashdrive command, sign in, and upload, find and read files from a terminal.",1795366546182]