in lambda/api/src/services/dynamoDBStorageService.ts [13:29]
public async getPet(id: string): Promise<Pet | null> {
try {
const data = await this.docClient.get({
TableName: this.tableName,
Key: {id},
ConsistentRead: true,
}).promise();
if (data && data.Item) {
return data.Item as Pet;
}
return null; // return null vs undefined
} catch (ex) { // AWSError
console.warn("Error getting entry", ex);
throw ex;
}
}