# Path: muranoagent/exceptions.py
# class AgentException(Exception):
# class CustomException(AgentException):
# class IncorrectFormat(AgentException):
#     def __init__(self, code, message=None, additional_data=None):
#     def error_code(self):
#     def additional_data(self):
#     def __init__(self, code, message=None, additional_data=None):


from oslo_utils import timeutils
from oslo_utils import uuidutils
from muranoagent import exceptions as exc
            'Body': result,
            'Time': str(timeutils.utcnow())
        }

    @staticmethod
    def from_error(error, execution_plan):
        if 'ID' not in execution_plan:
            raise ValueError('ID attribute is missing from execution plan')

        error_code = 1
        additional_info = None
        message = None
        if isinstance(error, int):
            error_code = error
        elif isinstance(error, Exception):
            message = str(error)
            if isinstance(error, exc.AgentException):
                error_code = error.error_code
                additional_info = error.additional_data

        return {
            'FormatVersion': '2.0.0',
            'ID': uuidutils.generate_uuid(dashed=False),
            'SourceID': execution_plan.ID,
            'Action': 'Execution:Result',
            'ErrorCode': error_code,
            'Body': {
                'Message': message,
                'AdditionalInfo': additional_info
            },

# Path: muranoagent/exceptions.py
# class AgentException(Exception):
# class CustomException(AgentException):
# class IncorrectFormat(AgentException):
#     def __init__(self, code, message=None, additional_data=None):
#     def error_code(self):
#     def additional_data(self):
#     def __init__(self, code, message=None, additional_data=None):


# Path: muranoagent/execution_result.py
from oslo_utils import timeutils
from oslo_utils import uuidutils
from muranoagent import exceptions as exc

            'Body': result,
            'Time': str(timeutils.utcnow())
        }

    @staticmethod
    def from_error(error, execution_plan):
        if 'ID' not in execution_plan:
            raise ValueError('ID attribute is missing from execution plan')

        error_code = 1
        additional_info = None
        message = None
        if isinstance(error, int):
            error_code = error
        elif isinstance(error, Exception):
            message = str(error)
            if isinstance(error, exc.AgentException):
                error_code = error.error_code
                additional_info = error.additional_data

        return {
            'FormatVersion': '2.0.0',
            'ID': uuidutils.generate_uuid(dashed=False),
            'SourceID': execution_plan.ID,
            'Action': 'Execution:Result',
            'ErrorCode': error_code,
            'Body': {
                'Message': message,
                'AdditionalInfo': additional_info
            },

            'Time': str(timeutils.utcnow())