File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -346,8 +346,11 @@ export class IdempotencyHandler<Func extends AnyFunction> {
346
346
347
347
return returnValue ;
348
348
} catch ( e ) {
349
+ /* if (!(e instanceof Error)) throw e;
350
+ if (e.name === 'IdempotencyItemAlreadyExistsError') { */
349
351
if ( e instanceof IdempotencyItemAlreadyExistsError ) {
350
- let idempotencyRecord = e . existingRecord ;
352
+ let idempotencyRecord = ( e as IdempotencyItemAlreadyExistsError )
353
+ . existingRecord ;
351
354
if ( idempotencyRecord !== undefined ) {
352
355
// If the error includes the existing record, we can use it to validate
353
356
// the record being processed and cache it in memory.
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ class IdempotencyItemAlreadyExistsError extends Error {
8
8
9
9
public constructor ( message ?: string , existingRecord ?: IdempotencyRecord ) {
10
10
super ( message ) ;
11
+ this . name = 'IdempotencyItemAlreadyExistsError' ;
11
12
this . existingRecord = existingRecord ;
12
13
}
13
14
}
You can’t perform that action at this time.
0 commit comments