Handle errors thrown by calculateZimmermanWateringScale

This commit is contained in:
Matthew Oslan
2019-06-06 13:01:26 -04:00
parent b44cd4502c
commit 16b13c1e43

View File

@@ -278,7 +278,12 @@ export const getWateringData = async function( req: express.Request, res: expres
let scale = -1, rainDelay = -1;
if ( adjustmentMethod === ADJUSTMENT_METHOD.ZIMMERMAN ) {
try {
scale = calculateZimmermanWateringScale( adjustmentOptions, wateringData );
} catch ( err ) {
res.send( "Error: " + err );
return;
}
}
if (wateringData) {