Handle errors thrown by calculateZimmermanWateringScale
This commit is contained in:
@@ -278,7 +278,12 @@ export const getWateringData = async function( req: express.Request, res: expres
|
|||||||
let scale = -1, rainDelay = -1;
|
let scale = -1, rainDelay = -1;
|
||||||
|
|
||||||
if ( adjustmentMethod === ADJUSTMENT_METHOD.ZIMMERMAN ) {
|
if ( adjustmentMethod === ADJUSTMENT_METHOD.ZIMMERMAN ) {
|
||||||
scale = calculateZimmermanWateringScale( adjustmentOptions, wateringData );
|
try {
|
||||||
|
scale = calculateZimmermanWateringScale( adjustmentOptions, wateringData );
|
||||||
|
} catch ( err ) {
|
||||||
|
res.send( "Error: " + err );
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wateringData) {
|
if (wateringData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user