Skip to content

Commit

Permalink
raises error when a plugin could not be located
Browse files Browse the repository at this point in the history
  • Loading branch information
asitang committed Oct 20, 2021
1 parent c1f1e8c commit 922127e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/jpl/pipedreams/plugins_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ def get_new_plugin(self, name):
# search for the plugin
# print('plugin def not found, looking:', name)
plugins = find_plugins(name)
if len(plugins) != 1:
# todo: throw error
print('More than one plugin found:', plugins)
return None
if len(plugins) == 0:
print('no plugin found:')
raise ModuleNotFoundError
elif len(plugins) > 1:
print('more than one plugin found:', plugins)
raise ImportError
else:
# print('plugin def found, adding and initializing:', name)
plugin = plugins[0]
Expand Down

0 comments on commit 922127e

Please sign in to comment.