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

@@ -29,11 +29,11 @@ export default class DarkSkyWeatherProvider extends WeatherProvider {
yesterdayData = await httpJSONRequest( yesterdayUrl );
} catch ( err ) {
console.error( "Error retrieving weather information from Dark Sky:", err );
throw new CodedError( ErrorCode.WeatherApiError, "An error occurred while retrieving weather information from Dark Sky." );
throw new CodedError( ErrorCode.WeatherApiError );
}
if ( !yesterdayData.hourly || !yesterdayData.hourly.data ) {
throw new CodedError( ErrorCode.MissingWeatherField, "Necessary field(s) were missing from weather information returned by Dark Sky." );
throw new CodedError( ErrorCode.MissingWeatherField );
}
const samples = [
@@ -42,7 +42,7 @@ export default class DarkSkyWeatherProvider extends WeatherProvider {
// Fail if not enough data is available.
if ( samples.length !== 24 ) {
throw new CodedError( ErrorCode.InsufficientWeatherData, "Insufficient data was returned by Dark Sky." );
throw new CodedError( ErrorCode.InsufficientWeatherData );
}
const totals = { temp: 0, humidity: 0, precip: 0 };
@@ -123,7 +123,7 @@ export default class DarkSkyWeatherProvider extends WeatherProvider {
try {
historicData = await httpJSONRequest( historicUrl );
} catch (err) {
throw new CodedError( ErrorCode.WeatherApiError, "An error occurred while retrieving weather information from Dark Sky." );
throw new CodedError( ErrorCode.WeatherApiError );
}
const cloudCoverInfo: CloudCoverInfo[] = historicData.hourly.data.map( ( hour ): CloudCoverInfo => {