Skip to content

Commit a070375

Browse files
committed
feedback
1 parent 2351d7d commit a070375

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/DdbMiddlewareConfig.dfy

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ module DdbMiddlewareConfig {
110110
"";
111111
var sort :=
112112
if config.sortKeyName.Some? && config.sortKeyName.value in item then
113-
"\n" + config.sortKeyName.value + " = " + AttrToString(item[config.sortKeyName.value])
113+
"; " + config.sortKeyName.value + " = " + AttrToString(item[config.sortKeyName.value])
114114
else
115115
"";
116116

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/ScanErrorExample.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
/*
2222
This example sets up DynamoDb Encryption for the AWS SDK client
23-
and uses the low level PutItem and GetItem DDB APIs to demonstrate
24-
putting a client-side encrypted item into DynamoDb
25-
and then retrieving and decrypting that item from DynamoDb.
23+
and uses the low level Scan operation to demonstrate
24+
retrieving the error messages from the returned CollectionOfErrors
25+
when some of the Scan results do not decrypt successfully.
2626
2727
Running this example requires access to the DDB Table whose name
2828
is provided in CLI arguments.
@@ -155,12 +155,13 @@ public static void ScanError(String kmsKeyId, String ddbTableName) {
155155

156156
try {
157157
final ScanResponse scanResponse = ddb.scan(scanRequest);
158+
assert false;
158159
} catch (Exception e) {
159-
System.err.println("Other Error : ");
160-
System.err.println(e);
161160
System.err.println(e.getMessage());
162161
System.err.println(e.getCause());
163-
System.err.println(((CollectionOfErrors) e.getCause()).list());
162+
for (RuntimeException err : ((CollectionOfErrors) e.getCause()).list()) {
163+
System.err.println(" " + err.getMessage());
164+
}
164165
}
165166
}
166167

Examples/runtimes/net/src/ScanErrorExample.cs

+5-9
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
/*
1212
This example sets up DynamoDb Encryption for the AWS SDK client
13-
and uses the low level PutItem and GetItem DDB APIs to demonstrate
14-
putting a client-side encrypted item into DynamoDb
15-
and then retrieving and decrypting that item from DynamoDb.
13+
and uses the low level Scan operation to demonstrate
14+
retrieving the error messages from the returned CollectionOfErrors
15+
when some of the Scan results do not decrypt successfully.
1616
1717
Running this example requires access to the DDB Table whose name
1818
is provided in CLI arguments.
@@ -123,10 +123,7 @@ public static async Task ScanError()
123123
try
124124
{
125125
var scanResponse = await ddb.ScanAsync(scanRequest);
126-
}
127-
catch (DynamoDbEncryptionException e)
128-
{
129-
Console.Error.WriteLine("Encryptor Error : " + e.Message);
126+
Debug.Assert(false);
130127
}
131128
catch (AWS.Cryptography.DbEncryptionSDK.DynamoDb.Transforms.CollectionOfErrors e)
132129
{
@@ -139,8 +136,7 @@ public static async Task ScanError()
139136
}
140137
catch (Exception e)
141138
{
142-
Console.Error.WriteLine("Other Error : ");
143-
Console.Error.WriteLine(e);
139+
Debug.Assert(false);
144140
}
145141
}
146142
}

0 commit comments

Comments
 (0)