kexue-z / nonebot-plugin-heweather

MIT License
63 stars 11 forks source link

无法获取某些城市天气,比如北京天气,报错,而且每天报错的城市都不一样 #22

Closed chung1912 closed 2 years ago

chung1912 commented 2 years ago

pydantic.error_wrappers.ValidationError 1 validation error for WarningApi warning -> 0 -> startTime

kexue-z commented 2 years ago

虽然我知道什么问题,但是你可以把别的debug日志也截出来吗

chung1912 commented 2 years ago

[ERROR] nonebot | Running matcher <Matcher from nonebot_plugin_heweather, type=message, priority=1, temp=False> failed. Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher.py", line 668, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher.py", line 635, in simple_run await handler( File "/usr/local/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(values) File "/usr/local/lib/python3.10/site-packages/nonebot_pluginheweather/init.py", line 47, in await w_data.load_data() File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_heweather/weather_data.py", line 62, in load_data self.now, self.daily, self.air, self.warning = await asyncio.gather( File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_heweather/weather_data.py", line 141, in _warning return WarningApi(res.json()) File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init raise validation_error pydantic.error_wrappers.ValidationError: 1 validation error for WarningApi warning -> 0 -> startTime field required (type=value_error.missing)

虽然我知道什么问题,但是你可以把别的debug日志也截出来吗

kexue-z commented 2 years ago

升级一下版本 最新的应该是 0.5.7

kexue-z commented 2 years ago

fixed at https://github.com/kexue-z/nonebot-plugin-heweather/commit/1d3eca4f025df99b810d7c76519e08eb6085dee1