def _get_error_result(self):
        _, exc_value, exc_traceback = sys.exc_info()

        is_fabric_failure = isinstance(exc_value, FabricExecutionFailureException)
        exc_value = str(exc_value)
        exc_traceback = ''.join(traceback.format_tb(exc_traceback))

        if is_fabric_failure:
            # Invalid authentication information
            if 'get_transport().open_session()' in exc_traceback:
                exc_value = 'Cannot connect to the server - invalid authentication info provided'
            elif 'sudo password' in exc_value:
                # sudo is not setup or it requires password
                exc_value = 'Passwordless sudo needs to be setup for user: %s' % (self.user)

        result = {}
        result['failed'] = True
        result['succeeded'] = False
        result['error'] = exc_value
        result['traceback'] = exc_traceback
        return result
Prepares a structured error result based on the exception.
dataset/ETHPy150Open StackStorm/st2/st2common/st2common/models/system/action.py/ShellCommandAction._get_error_result