Skip to content

Commit 3cd6556

Browse files
committed
addressing PR feedback: improve changelog message, shorten some names
1 parent bd1db0a commit 3cd6556

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.changes/3456d00f-1b29-4d88-ab02-045db1b1ebce.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "3456d00f-1b29-4d88-ab02-045db1b1ebce",
33
"type": "bugfix",
4-
"description": "Include more information when retry strategy halts early due to capacity errors",
4+
"description": "Include more information when retry strategy halts early due to token bucket capacity errors",
55
"issues": [
66
"awslabs/aws-sdk-kotlin#1321"
77
]

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/Exceptions.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public open class ErrorMetadata {
5454
/**
5555
* Set if there are additional context elements about the error
5656
*/
57-
public val AdditionalClientContext: AttributeKey<List<ClientErrorContext>> =
58-
AttributeKey("aws.smithy.kotlin#AdditionalClientContext")
57+
public val ClientContext: AttributeKey<List<ClientErrorContext>> =
58+
AttributeKey("aws.smithy.kotlin#ClientContext")
5959

6060
/**
6161
* Set if an error is retryable
@@ -74,8 +74,8 @@ public open class ErrorMetadata {
7474
public val isThrottling: Boolean
7575
get() = attributes.getOrNull(ThrottlingError) ?: false
7676

77-
public val additionalClientContext: List<ClientErrorContext>
78-
get() = attributes.getOrNull(AdditionalClientContext).orEmpty()
77+
public val clientContext: List<ClientErrorContext>
78+
get() = attributes.getOrNull(ClientContext).orEmpty()
7979
}
8080

8181
/**
@@ -213,7 +213,7 @@ public open class ServiceException : SdkBaseException {
213213

214214
sdkErrorMetadata.requestId?.let { add("Request ID: $it") }
215215

216-
sdkErrorMetadata.additionalClientContext.mapTo(this@buildList) { it.formatted }
216+
sdkErrorMetadata.clientContext.mapTo(this@buildList) { it.formatted }
217217
}
218218

219219
override val message: String

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/retries/StandardRetryStrategy.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public open class StandardRetryStrategy(override val config: Config = Config.def
156156

157157
is ServiceException -> retryableException.apply {
158158
val addCtx = ClientErrorContext("Early retry termination", capacityMessage)
159-
sdkErrorMetadata.attributes.appendValue(ErrorMetadata.AdditionalClientContext, addCtx)
159+
sdkErrorMetadata.attributes.appendValue(ErrorMetadata.ClientContext, addCtx)
160160
}
161161

162162
else -> retryableException

runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/ExceptionsTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class ExceptionsTest {
113113
@Test
114114
fun testNoMessageWithClientContext() {
115115
val e = FooServiceException {
116-
appendValue(ErrorMetadata.AdditionalClientContext, ClientErrorContext(CTX_KEY_1, CTX_VALUE_1))
117-
appendValue(ErrorMetadata.AdditionalClientContext, ClientErrorContext(CTX_KEY_2, CTX_VALUE_2))
116+
appendValue(ErrorMetadata.ClientContext, ClientErrorContext(CTX_KEY_1, CTX_VALUE_1))
117+
appendValue(ErrorMetadata.ClientContext, ClientErrorContext(CTX_KEY_2, CTX_VALUE_2))
118118
}
119119
assertEquals(
120120
buildList {
@@ -130,8 +130,8 @@ class ExceptionsTest {
130130
@Test
131131
fun testMessageWithClientContext() {
132132
val e = FooServiceException(SERVICE_MESSAGE) {
133-
appendValue(ErrorMetadata.AdditionalClientContext, ClientErrorContext(CTX_KEY_1, CTX_VALUE_1))
134-
appendValue(ErrorMetadata.AdditionalClientContext, ClientErrorContext(CTX_KEY_2, CTX_VALUE_2))
133+
appendValue(ErrorMetadata.ClientContext, ClientErrorContext(CTX_KEY_1, CTX_VALUE_1))
134+
appendValue(ErrorMetadata.ClientContext, ClientErrorContext(CTX_KEY_2, CTX_VALUE_2))
135135
}
136136
assertEquals(
137137
"$SERVICE_MESSAGE, $CTX_KEY_1: $CTX_VALUE_1, $CTX_KEY_2: $CTX_VALUE_2",

0 commit comments

Comments
 (0)