mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Give friendlier error when package can't be found during bot startup (#4079)
This commit is contained in:
parent
dcc77cf24f
commit
5507816c42
@ -700,12 +700,20 @@ class RedBase(
|
||||
for package in packages:
|
||||
try:
|
||||
spec = await self._cog_mgr.find_cog(package)
|
||||
if spec is None:
|
||||
log.error(
|
||||
"Failed to load package %s (package was not found in any cog path)",
|
||||
package,
|
||||
)
|
||||
await self.remove_loaded_package(package)
|
||||
to_remove.append(package)
|
||||
continue
|
||||
await asyncio.wait_for(self.load_extension(spec), 30)
|
||||
except asyncio.TimeoutError:
|
||||
log.exception("Failed to load package %s (timeout)", package)
|
||||
to_remove.append(package)
|
||||
except Exception as e:
|
||||
log.exception("Failed to load package {}".format(package), exc_info=e)
|
||||
log.exception("Failed to load package %s", package, exc_info=e)
|
||||
await self.remove_loaded_package(package)
|
||||
to_remove.append(package)
|
||||
for package in to_remove:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user