-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom S3 Error Metadata Support #323
Comments
Before I forget... I'm not sure I understand (3) Relevant to (2)/(4) : https://aws.amazon.com/premiumsupport/knowledge-center/s3-request-id-values/ Here is what Go does for (1):
I think we should separate some of these out into multiple issues, in particular the 200 response errors. Unless I'm mistaken about (3) I also think all of these fall under supplemental middleware that extend/augment the existing response/error middleware. The secondary request ID is a good candidate for implementing as For the response/error metadata we could be generating service specific containers like
|
This may be a NOP. I see in the S3 model that there are no error codes defined (via trait) in the S3 smithy model. We default to 400 if client errors are unspecified. When looking at the codegen and seeing everything maps to |
Thanks for all the details above @aajtodd , very helpful. As suggested I've broken this ticket into two. This will track handing the response fields particular to S3 and the new issue will deal w/ the 200 error handler. I have yet to hear anything definitive regarding modeling error codes for S3 in service, but at this time I would say it's invalid. Will update here if turns out to be otherwise. |
status: got some first-pass work done of codegen of S3 error types. Using Aaron's sample code above. |
I played around with trying to override the metadata property via the extension property mechanism. It compiles but does not allow for overridding a property of an existing type. Sample: open class AwsErrorMetadata() {
private val _prop = "asdf"
public val propA: String?
get() = _prop
}
open class ServiceErrorMetadata(): AwsErrorMetadata() {
private val _prop2 = "werwerw"
public val propB: String?
get() = _prop2
}
open class AwsServiceException {
open val sdkErrorMetadata: AwsErrorMetadata = AwsErrorMetadata()
}
open class SomeServiceException(): AwsServiceException() {
override val sdkErrorMetadata: ServiceErrorMetadata
get() = ServiceErrorMetadata()
}
// Doesn't fail to compile but does not change types
val AwsServiceException.sdkErrorMetadata: ServiceErrorMetadata
get() = ServiceErrorMetadata()
fun main() {
val a = SomeServiceException()
println(a.sdkErrorMetadata.propB)
} |
I've got a rough cut now working. Not my intention to put into a PR but what I got working in the way that was simplest and most obvious to me at the time:
|
Work necessary to successfully parse/deserialize error metadata from S3
Support errors in the body of a 200 responseMap error code to exception typeestimate: 2 weeks (.5 completed)
The text was updated successfully, but these errors were encountered: