Give error details instead of just spontaneously quitting

This commit is contained in:
Arinerron 2019-03-30 17:25:07 -07:00
parent 0fe241bea2
commit 82c29bfcbe
No known key found for this signature in database
GPG Key ID: 99383627861C62F0

View File

@ -69,9 +69,10 @@ def enable(name, onionr = None, start_event = True):
if not name in enabled_plugins: if not name in enabled_plugins:
try: try:
events.call(get_plugin(name), 'enable', onionr) events.call(get_plugin(name), 'enable', onionr)
except ImportError: # Was getting import error on Gitlab CI test "data" except ImportError as e: # Was getting import error on Gitlab CI test "data"
# NOTE: If you are experiencing issues with plugins not being enabled, it might be this resulting from an error in the module # NOTE: If you are experiencing issues with plugins not being enabled, it might be this resulting from an error in the module
# can happen inconsistenly (especially between versions) # can happen inconsistenly (especially between versions)
logger.debug('Failed to enable module; Import error: %s' % e)
return False return False
else: else:
enabled_plugins.append(name) enabled_plugins.append(name)
@ -83,7 +84,8 @@ def enable(name, onionr = None, start_event = True):
else: else:
return False return False
else: else:
logger.error('Failed to enable plugin \"%s\", disabling plugin.' % name) logger.error('Failed to enable plugin \"%s\" (disabling plugin).' % name)
logger.debug('Plugins folder not found: %s' % get_plugins_folder(str(name).lower()))
disable(name) disable(name)
return False return False