File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/idempotency/src/persistence Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { IdempotencyRecordStatus } from '../constants';
6
6
import type { DynamoDBPersistenceOptions } from '../types' ;
7
7
import {
8
8
AttributeValue ,
9
+ ConditionalCheckFailedException ,
9
10
DeleteItemCommand ,
10
11
DynamoDBClient ,
11
12
DynamoDBClientConfig ,
@@ -200,15 +201,13 @@ class DynamoDBPersistenceLayer extends BasePersistenceLayer {
200
201
) ;
201
202
} catch ( error ) {
202
203
if ( error instanceof DynamoDBServiceException ) {
203
- if ( error . name === ' ConditionalCheckFailedException' ) {
204
+ if ( error instanceof ConditionalCheckFailedException ) {
204
205
throw new IdempotencyItemAlreadyExistsError (
205
- `Failed to put record for already existing idempotency key: ${ record . idempotencyKey } `
206
+ `Failed to put record for already existing idempotency key: ${ record . idempotencyKey } ` ,
207
+ error . Item
206
208
) ;
207
209
}
208
210
}
209
-
210
- throw error ;
211
- }
212
211
}
213
212
214
213
protected async _updateRecord ( record : IdempotencyRecord ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments