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

@@ -26,12 +26,12 @@ export default class OWMWeatherProvider extends WeatherProvider {
forecast = await httpJSONRequest( forecastUrl );
} catch ( err ) {
console.error( "Error retrieving weather information from OWM:", err );
throw new CodedError( ErrorCode.WeatherApiError, "An error occurred while retrieving weather information from OWM." );
throw new CodedError( ErrorCode.WeatherApiError );
}
// Indicate watering data could not be retrieved if the forecast data is incomplete.
if ( !forecast || !forecast.list ) {
throw new CodedError( ErrorCode.MissingWeatherField, "Necessary field(s) were missing from weather information returned by OWM." );
throw new CodedError( ErrorCode.MissingWeatherField );
}
let totalTemp = 0,
@@ -112,12 +112,12 @@ export default class OWMWeatherProvider extends WeatherProvider {
forecast = await httpJSONRequest( forecastUrl );
} catch (err) {
console.error( "Error retrieving ETo information from OWM:", err );
throw new CodedError( ErrorCode.WeatherApiError, "An error occurred while retrieving ETo information from OWM." );
throw new CodedError( ErrorCode.WeatherApiError );
}
// Indicate ETo data could not be retrieved if the forecast data is incomplete.
if ( !forecast || !forecast.list || forecast.list.length < 8 ) {
throw new CodedError( ErrorCode.InsufficientWeatherData, "Insufficient data available from OWM." );
throw new CodedError( ErrorCode.InsufficientWeatherData );
}
// Take a sample over 24 hours.