示例#1
0
 def execute(self, context):
     stacktrace = stack_trace.create_stack_trace(context, False)
     cause = None
     if self._cause:
         cause = helpers.evaluate(self._cause, context).get_property(
             'nativeException')
     raise dsl_exception.MuranoPlException(
         list(self._resolve_names(helpers.evaluate(self._names, context),
                                  context)),
         helpers.evaluate(self._message, context),
         stacktrace, self._extra, cause)
示例#2
0
 def execute(self, context):
     stacktrace = stack_trace.create_stack_trace(context, False)
     cause = None
     if self._cause:
         cause = helpers.evaluate(self._cause,
                                  context).get_property('nativeException')
     raise dsl_exception.MuranoPlException(
         list(
             self._resolve_names(helpers.evaluate(self._names, context),
                                 context)),
         helpers.evaluate(self._message, context), stacktrace, self._extra,
         cause)
    def from_python_exception(exception, context):
        stacktrace = stack_trace.create_stack_trace(context)
        exception_type = type(exception)
        names = ['{0}.{1}'.format(exception_type.__module__,
                                  exception_type.__name__)]

        result = MuranoPlException(
            names, str(exception), stacktrace)
        _, _, exc_traceback = sys.exc_info()
        result.original_exception = exception
        result.original_traceback = exc_traceback
        return result
示例#4
0
    def from_python_exception(exception, context):
        stacktrace = stack_trace.create_stack_trace(context)
        exception_type = type(exception)
        names = [
            '{0}.{1}'.format(exception_type.__module__,
                             exception_type.__name__)
        ]

        result = MuranoPlException(names, str(exception), stacktrace)
        _, _, exc_traceback = sys.exc_info()
        result.original_exception = exception
        result.original_traceback = exc_traceback
        return result
示例#5
0
    def from_python_exception(exception, context):
        stacktrace = stack_trace.create_stack_trace(context)
        exception_type = type(exception)
        builtins_module = 'builtins' if six.PY3 else 'exceptions'
        module = exception_type.__module__
        if module == builtins_module:
            names = [exception_type.__name__]
        else:
            names = ['{0}.{1}'.format(exception_type.__module__,
                                      exception_type.__name__)]

        result = MuranoPlException(
            names, str(exception), stacktrace)
        _, _, exc_traceback = sys.exc_info()
        result.original_exception = exception
        result.original_traceback = exc_traceback
        return result
    def from_python_exception(exception, context):
        stacktrace = stack_trace.create_stack_trace(context)
        exception_type = type(exception)
        builtins_module = 'builtins' if six.PY3 else 'exceptions'
        module = exception_type.__module__
        if module == builtins_module:
            names = [exception_type.__name__]
        else:
            names = [
                '{0}.{1}'.format(exception_type.__module__,
                                 exception_type.__name__)
            ]

        result = MuranoPlException(names, str(exception), stacktrace)
        _, _, exc_traceback = sys.exc_info()
        result.original_exception = exception
        result.original_traceback = exc_traceback
        return result