Remove errMessage

This commit is contained in:
Matthew Oslan
2019-09-01 15:05:41 -04:00
parent f8d3c64a33
commit 2918527bcb
9 changed files with 29 additions and 42 deletions

View File

@@ -44,14 +44,6 @@ export interface AdjustmentMethodResponse {
* watering.
*/
rainDelay?: number;
/**
* An message to send to the OS firmware to indicate that an error occurred while calculating the watering
* scale and the returned scale either defaulted to some reasonable value or was calculated with incomplete data.
* Older firmware versions will ignore this field (they will silently swallow the error and use the returned scale),
* but newer firmware versions may be able to alert the user that an error occurred and/or default to a
* user-configured watering scale instead of using the one returned by the AdjustmentMethod.
*/
errMessage?: string;
/** A code describing the type of error that occurred (if one occurred). */
errCode?: ErrorCode;
/** The data that was used to calculate the watering scale, or undefined if no data was used. */

View File

@@ -18,7 +18,7 @@ async function calculateEToWateringScale(
): Promise< AdjustmentMethodResponse > {
if ( pws ) {
throw new CodedError( ErrorCode.PwsNotSupported, "ETo adjustment method does not support personal weather stations through WUnderground." );
throw new CodedError( ErrorCode.PwsNotSupported );
}
// Temporarily disabled since OWM forecast data is checking if rain is forecasted for 3 hours in the future.
@@ -41,7 +41,7 @@ async function calculateEToWateringScale(
if ( adjustmentOptions && "baseETo" in adjustmentOptions ) {
baseETo = adjustmentOptions.baseETo
} else {
throw new CodedError( ErrorCode.MissingAdjustmentOption, "A baseline potential ETo must be provided." );
throw new CodedError( ErrorCode.MissingAdjustmentOption );
}
if ( adjustmentOptions && "elevation" in adjustmentOptions ) {

View File

@@ -43,7 +43,6 @@ async function calculateZimmermanWateringScale(
scale: 100,
rawData: rawData,
errCode: ErrorCode.MissingWeatherField,
errMessage: "Necessary field(s) were missing from ZimmermanWateringData.",
wateringData: wateringData
};
}