Skip to content

Commit

Permalink
Log exception traceback from weather provider to DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
dgw authored and RustyBower committed Nov 26, 2023
1 parent 19a713d commit 44008d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sopel_modules/weather/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from sopel.config.types import NO_DEFAULT, BooleanAttribute, ChoiceAttribute, StaticSection, ValidatedAttribute
from sopel.plugin import commands, example, NOLIMIT
from sopel.tools import Identifier
from sopel.tools import get_logger, Identifier
from sopel.tools.time import format_time

from .providers.weather.openmeteo import openmeteo_forecast, openmeteo_weather
Expand All @@ -34,6 +34,8 @@
'locationiq': 'https://us1.locationiq.com/v1/search.php',
}

LOGGER = get_logger('weather')


# Define our sopel weather configuration
class WeatherSection(StaticSection):
Expand Down Expand Up @@ -300,6 +302,7 @@ def weather_command(bot, trigger):
data = get_weather(bot, trigger)
except Exception as err:
bot.reply("Could not get weather: " + str(err))
LOGGER.debug('Error in weather provider.', exc_info=err)
return

weather = u'{location}: {temp}, {condition}, {humidity}'.format(
Expand Down

0 comments on commit 44008d2

Please sign in to comment.