File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,16 +49,26 @@ export class SupplierQuotasRepository {
4949 }
5050
5151 async putOverallAllocation ( allocation : OverallAllocation ) : Promise < void > {
52- await this . ddbClient . send (
53- new PutCommand ( {
54- TableName : this . config . supplierQuotasTableName ,
55- Item : ItemForRecord (
56- "overall-allocation" ,
57- allocation . id ,
58- $OverallAllocation . parse ( allocation ) ,
59- ) ,
60- } ) ,
61- ) ;
52+ try {
53+ const parsedAllocation = $OverallAllocation . parse ( allocation ) ;
54+ await this . ddbClient . send (
55+ new PutCommand ( {
56+ TableName : this . config . supplierQuotasTableName ,
57+ Item : ItemForRecord (
58+ "overall-allocation" ,
59+ allocation . id ,
60+ parsedAllocation ,
61+ ) ,
62+ } ) ,
63+ ) ;
64+ } catch ( error ) {
65+ if ( error instanceof Error ) {
66+ throw new Error (
67+ `Failed to put overall allocation for id ${ allocation . id } : ${ error . message } ` ,
68+ ) ;
69+ }
70+ throw error ;
71+ }
6272 }
6373
6474 // Update the overallAllocation table updating the allocations array for a given volume group
You can’t perform that action at this time.
0 commit comments