From a3ea8baf1e7c44505a05378d081099547640fe32 Mon Sep 17 00:00:00 2001 From: Florian Strzelecki Date: Sat, 20 Apr 2019 11:32:26 +0200 Subject: [PATCH] plugins: raise a PluginError when PyFilePlugin fails --- sopel/plugins/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sopel/plugins/handlers.py b/sopel/plugins/handlers.py index 04d5b24f20..7dbc3bc881 100644 --- a/sopel/plugins/handlers.py +++ b/sopel/plugins/handlers.py @@ -36,6 +36,7 @@ import os from sopel import loader +from . import exceptions try: from importlib import reload @@ -283,8 +284,7 @@ def __init__(self, filename): name = os.path.basename(filename) module_type = imp.PKG_DIRECTORY else: - # TODO: throw more specific exception - raise Exception('Invalid Sopel plugin: %s' % filename) + raise exceptions.PluginError('Invalid Sopel plugin: %s' % filename) self.filename = filename self.path = filename