import sys

class Process(object):
    
    def __init__(self):
        pass

    def log(self, msg):
        self.logger.info('{0} for run {1}: {2}'.format(self.__class__.__name__, self.run_name, msg))
    
    def run(self, config):
        try:
            if isinstance(self, HarvesterProcess):
                return self.harvest(config)
            elif isinstance(self, ExtractorProcess):
                return self.extract(config)
        except ProcessError as r:
            return r
        except Exception as e:
            #e_info = sys.exc_info()
            #self.log(''.join(traceback.format_exception(*e_info)))
            return ProcessError('{0}: {1}'.format(e.__class__.__name__, e))    


class HarvesterProcess(Process):
    def harvest(self, config):
        raise ProcessError('Override this method')
    
class ExtractorProcess(Process):
    def extract(self, data):
        raise ProcessError('Override this method')
    

class ProcessError(Exception):
    
    def __init__(self, msg):
        self.msg = msg
        
    def __unicode__(self):
        return "RunnableError: {0}".format(self.msg)

@@ -976,29 +976,34 @@
 ption):%0A    
+pass
 %0A    
+#
 def __init__
@@ -1014,104 +1014,77 @@
 f, m
-sg
+essage
 ):%0A    
+#
     s
-elf.msg = msg%0A        %0A    def __unicode__(self):%0A        return %22Runnable
+uper(ProcessError, self).__init__('Process
 Error: %7B
 0%7D%22.
@@ -1083,19 +1083,18 @@
 r: %7B
-0%7D%22
+%7D'
 .format(
 self
@@ -1093,14 +1093,13 @@
 mat(
-self.msg)%0A
+message))

Fix defined exception