gpt4 book ai didi

amazon-web-services - 如何在 AWSJavaScriptSDK 中以 200 OK 结果捕获失败的 S3 copyObject

转载 作者:行者123 更新时间:2023-12-03 17:00:47 27 4
gpt4 key购买 nike

Documentation AWSJavaScriptSDK 中的 S3.copyObject 方法指示以下内容:

A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 is copying the files. If the error occurs before the copy operation starts, you receive a standard Amazon S3 error. If the error occurs during the copy operation, the error response is embedded in the 200 OK response. This means that a 200 OK response can contain either a success or an error. Design your application to parse the contents of the response and handle it appropriately.



但是,没有给出失败可能是什么样子的示例,以及与 aws-sdk 中的 copyObject 关联的类型。节点库(即 CopyObjectResult 和 S3.Types.CopyObjectOutput)表明在成功响应中没有报告失败副本的地方。

有谁知道如何解释这个文档?在向 copyObject 返回 200 OK 时复制操作失败的示例是什么,调用者如何知道?

最佳答案

SDK 本身将 200 个状态 OK 响应转化为特定 API 调用的错误,包括 copyObject。

截至 this commit ,操作completeMultipartUpload , copyObject , 和 uploadPartCopyflagged因为能够返回实际上是错误的状态代码 200,并且有一个 handler将这些响应强制转换为错误响应。

关于amazon-web-services - 如何在 AWSJavaScriptSDK 中以 200 OK 结果捕获失败的 S3 copyObject,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61124130/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com