From 7b794600d10f1591334a6fcf268905a7a92d3526 Mon Sep 17 00:00:00 2001 From: kaktus42 Date: Fri, 3 Jul 2015 17:23:36 -0500 Subject: [PATCH 1/2] add error message for bad dependency declaration I got crazy identifying this error. The only error was a generic "KeyError" This will help others to detect the problem in their tool files. --- lib/galaxy/tools/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 802bf6ca404..d39660fedc6 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1060,6 +1060,9 @@ class Tool( object, Dictifiable ): # If parameter depends on any other paramters, we must refresh the # form when it changes for name in param.get_dependencies(): + # Let it throw exception, but give some hint what the problem might be + if name not in context: + log.error("Could not find dependency '%s' for tool %s" % (name, self.name) ) context[ name ].refresh_on_change = True return param From 679924ac86eae46e91388b8760662d42afc4507a Mon Sep 17 00:00:00 2001 From: kaktus42 Date: Fri, 3 Jul 2015 17:28:38 -0500 Subject: [PATCH 2/2] improve error message --- lib/galaxy/tools/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index d39660fedc6..f36dfc774ac 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1062,7 +1062,7 @@ class Tool( object, Dictifiable ): for name in param.get_dependencies(): # Let it throw exception, but give some hint what the problem might be if name not in context: - log.error("Could not find dependency '%s' for tool %s" % (name, self.name) ) + log.error("Could not find dependency '%s' of parameter '%s' in tool %s" % (name, param.name, self.name) ) context[ name ].refresh_on_change = True return param