fix to mako import and some up-stack error reporting in tools

This commit is contained in:
Carl Eberhard
2012-08-08 12:30:25 -04:00
parent 624fa70cbc
commit 217690a63a
2 changed files with 8 additions and 4 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ Classes encapsulating galaxy tools and tool configuration.
import pkg_resources
pkg_resources.require( "simplejson" )
pkg_resources.require( "Mako" )
import logging, os, string, sys, tempfile, glob, shutil, types, urllib, subprocess, random, math, traceback
import simplejson
@@ -2344,7 +2345,7 @@ class Tool:
command_line = command_line.replace( "\n", " " ).replace( "\r", " " ).strip()
except Exception, e:
# Modify exception message to be more clear
#e.args = ( 'Error substituting into command line. Params: %r, Command: %s' % ( param_dict, self.command ) )
#e.args = ( 'Error substituting into command line. Params: %r, Command: %s' % ( param_dict, self.command ), )
raise
if self.interpreter:
# TODO: path munging for cluster/dataset server relocatability
@@ -2441,7 +2442,7 @@ class Tool:
if code:
return code( *args, **kwargs )
except Exception, e:
e.args = ( "Error in '%s' hook '%s', original message: %s" % ( self.name, hook_name, e.args[0] ) )
e.args = ( "Error in '%s' hook '%s', original message: %s" % ( self.name, hook_name, e.args[0] ), )
raise
def exec_before_job( self, app, inp_data, out_data, param_dict={} ):
pass
+5 -2
View File
@@ -3,6 +3,9 @@ import os
from galaxy import eggs
from galaxy import jobs
from galaxy.tools.parameters import DataToolParameter
from galaxy.jobs.handler import JOB_ERROR
# Older py compatibility
try:
set()
@@ -63,8 +66,8 @@ def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=No
raise Exception( stderr )
except Exception, exc:
data.blurb = jobs.JOB_ERROR
data.state = jobs.JOB_ERROR
data.blurb = JOB_ERROR
data.state = JOB_ERROR
## def exec_after_process(app, inp_data, out_data, param_dict, tool=None, stdout=None, stderr=None):
## pass