Skip to content

Commit

Permalink
Change errors to warnings - client code will have to log this if it n…
Browse files Browse the repository at this point in the history
…eeds to
  • Loading branch information
colinnuk committed Apr 9, 2024
1 parent 8ad1b3f commit 0f46876
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions OpenMeteo/OpenMeteoClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public OpenMeteoClient(bool rethrowExceptions, IOpenMeteoLogger? logger = null)
}
catch (HttpRequestException e)
{
_logger?.Error($"{nameof(OpenMeteoClient)}.GetAirQualityAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
_logger?.Warning($"{nameof(OpenMeteoClient)}.GetAirQualityAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
if (_rethrowExceptions)
throw;
return null;
Expand Down Expand Up @@ -340,7 +340,7 @@ public string WeathercodeToString(int weathercode)
}
catch (Exception e)
{
_logger?.Error($"{nameof(OpenMeteoClient)}.GetWeatherForecastAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
_logger?.Warning($"{nameof(OpenMeteoClient)}.GetWeatherForecastAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
if (_rethrowExceptions)
throw;
return null;
Expand All @@ -364,7 +364,7 @@ public string WeathercodeToString(int weathercode)
}
catch (HttpRequestException e)
{
_logger?.Error($"{nameof(OpenMeteoClient)}.GetGeocodingDataAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
_logger?.Warning($"{nameof(OpenMeteoClient)}.GetGeocodingDataAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
if (_rethrowExceptions)
throw;
return null;
Expand All @@ -387,7 +387,7 @@ public string WeathercodeToString(int weathercode)
catch (HttpRequestException e)
{
_logger?.Warning($"Can't find elevation for latitude {options.Latitude} & longitude {options.Longitude}. Please make sure that they are valid.");
_logger?.Error($"Error in {nameof(OpenMeteoClient)}.GetElevationAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
_logger?.Warning($"Error in {nameof(OpenMeteoClient)}.GetElevationAsync(). Message: {e.Message} StackTrace: {e.StackTrace}");
if (_rethrowExceptions)
throw;
return null;
Expand Down

0 comments on commit 0f46876

Please sign in to comment.