mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Better error message when disabling unknown plugin
This commit is contained in:
parent
781c73ff5f
commit
9cb1c50887
@ -83,6 +83,8 @@ def load_plugin(path_to_zip_file): # {{{
|
||||
def disable_plugin(plugin_or_name):
|
||||
x = getattr(plugin_or_name, 'name', plugin_or_name)
|
||||
plugin = find_plugin(x)
|
||||
if plugin is None:
|
||||
raise ValueError(f'No plugin named: {x} found')
|
||||
if not plugin.can_be_disabled:
|
||||
raise ValueError('Plugin %s cannot be disabled'%x)
|
||||
dp = config['disabled_plugins']
|
||||
|
Loading…
x
Reference in New Issue
Block a user