-
Notifications
You must be signed in to change notification settings - Fork 647
Closed
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
When I use GetObjectCommand with the IfNoneMatch parameter set to the ETag that matches the current value of the object, I get an unexpected error:
{
"name": "304",
"$fault": "client",
"$metadata": {
"httpStatusCode": 304,
"requestId": "txf0dab84e1901420c995fe-0065e8c28e",
"extendedRequestId": "txf0dab84e1901420c995fe-0065e8c28e",
"attempts": 1,
"totalRetryDelay": 0
},
"message": "UnknownError"
}According to the docs it should return return a "304 Not Modified error". I can work around this oddity, but it would be nice to have this error named consistently with other.
SDK version number
@aws-sdk/package-name@3.523.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.10.0
Reproduction Steps
try {
let getParam = { Bucket: username, Key: s3Path, IfNoneMatch: condition.ETag };
const { Body, ETag, ContentType, ContentLength } = await this.#S3Client.send(new GetObjectCommand(getParam));
//...
} catch (err) {
if (err.name === 'NotModified' ) {
return { status: 304, readStream: null, contentType: null, contentLength: null, ETag: null };
} else {
throw Object.assign(err, { status: 502 });
}Observed Behavior
This error is thrown:
{
"name": "304",
"$fault": "client",
"$metadata": {
"httpStatusCode": 304,
"requestId": "txf0dab84e1901420c995fe-0065e8c28e",
"extendedRequestId": "txf0dab84e1901420c995fe-0065e8c28e",
"attempts": 1,
"totalRetryDelay": 0
},
"message": "UnknownError"
}Expected Behavior
An error with name "NotModified"
Possible Solution
double-check there is code to handle an HTTP status of 304
Additional Information/Context
I confess I have only run this against min.io and OpenIO - i assumed AWS S3 would work. I'm scheduled to test against AWS S3 soon.
tjackowiak
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog