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

@@ -7,7 +7,7 @@ export default class WUnderground extends WeatherProvider {
async getWateringData( coordinates: GeoCoordinates, pws?: PWS ): Promise< ZimmermanWateringData > {
if ( !pws ) {
throw new CodedError( ErrorCode.NoPwsProvided, "WUnderground WeatherProvider requires a PWS to be specified." );
throw new CodedError( ErrorCode.NoPwsProvided );
}
const url = `https://api.weather.com/v2/pws/observations/hourly/7day?stationId=${ pws.id }&format=json&units=e&apiKey=${ pws.apiKey }`;
@@ -16,7 +16,7 @@ export default class WUnderground extends WeatherProvider {
data = await httpJSONRequest( url );
} catch ( err ) {
console.error( "Error retrieving weather information from WUnderground:", err );
throw new CodedError( ErrorCode.WeatherApiError, "An error occurred while retrieving weather information from WUnderground." );
throw new CodedError( ErrorCode.WeatherApiError );
}
// Take the 24 most recent observations.
@@ -24,7 +24,7 @@ export default class WUnderground extends WeatherProvider {
// Fail if not enough data is available.
if ( samples.length !== 24 ) {
throw new CodedError( ErrorCode.InsufficientWeatherData, "Insufficient data was returned by WUnderground." );
throw new CodedError( ErrorCode.InsufficientWeatherData );
}
const totals = { temp: 0, humidity: 0, precip: 0 };