@openstax/ts-utils 1.15.3 → 1.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63,6 +63,9 @@ export const dynamoUnversionedDocumentStore = (initializer) => () => (configProv
|
|
|
63
63
|
throw new NotFoundError(`Item with ${key} "${id}" does not exist`);
|
|
64
64
|
}
|
|
65
65
|
return parseFloat(result);
|
|
66
|
+
}).catch((error) => {
|
|
67
|
+
throw error.name === 'ConditionalCheckFailedException' ?
|
|
68
|
+
new NotFoundError(`Item with ${key} "${id}" does not exist`) : error;
|
|
66
69
|
});
|
|
67
70
|
},
|
|
68
71
|
/* replaces only specified attributes with the given data */
|
|
@@ -95,9 +98,12 @@ export const dynamoUnversionedDocumentStore = (initializer) => () => (configProv
|
|
|
95
98
|
});
|
|
96
99
|
return dynamodb().send(cmd).then((item) => {
|
|
97
100
|
if (!item.Attributes) {
|
|
98
|
-
throw new
|
|
101
|
+
throw new NotFoundError(`Item with ${key} "${id}" does not exist`);
|
|
99
102
|
}
|
|
100
103
|
return decodeDynamoDocument(item.Attributes);
|
|
104
|
+
}).catch((error) => {
|
|
105
|
+
throw error.name === 'ConditionalCheckFailedException' ?
|
|
106
|
+
new NotFoundError(`Item with ${key} "${id}" does not exist`) : error;
|
|
101
107
|
});
|
|
102
108
|
},
|
|
103
109
|
/* replaces the entire document with the given data */
|