mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-08 18:32:32 -05:00
Catch TypeError when setting global locale (#6518)
This commit is contained in:
@@ -1147,7 +1147,7 @@ class Red(
|
|||||||
i18n_locale = await self._config.locale()
|
i18n_locale = await self._config.locale()
|
||||||
try:
|
try:
|
||||||
_i18n.set_global_locale(i18n_locale)
|
_i18n.set_global_locale(i18n_locale)
|
||||||
except ValueError:
|
except (ValueError, TypeError):
|
||||||
log.warning(
|
log.warning(
|
||||||
"The bot's global locale was set to an invalid value (%r)"
|
"The bot's global locale was set to an invalid value (%r)"
|
||||||
" and will be reset to default (%s).",
|
" and will be reset to default (%s).",
|
||||||
@@ -1159,7 +1159,7 @@ class Red(
|
|||||||
i18n_regional_format = await self._config.regional_format()
|
i18n_regional_format = await self._config.regional_format()
|
||||||
try:
|
try:
|
||||||
_i18n.set_global_regional_format(i18n_regional_format)
|
_i18n.set_global_regional_format(i18n_regional_format)
|
||||||
except ValueError:
|
except (ValueError, TypeError):
|
||||||
log.warning(
|
log.warning(
|
||||||
"The bot's global regional format was set to an invalid value (%r)"
|
"The bot's global regional format was set to an invalid value (%r)"
|
||||||
" and will be reset to default (which is to inherit global locale, i.e. %s).",
|
" and will be reset to default (which is to inherit global locale, i.e. %s).",
|
||||||
|
|||||||
Reference in New Issue
Block a user