Source code for agentscope.exception._exception_base
# -*- coding: utf-8 -*-"""The base exception class in agentscope."""
[docs]classAgentOrientedExceptionBase(Exception):"""The base class for all agent-oriented exceptions. These exceptions are expect to the captured and exposed to the agent during runtime, so that agents can handle the error appropriately during the runtime. """
[docs]def__init__(self,message:str):"""Initialize the exception with a message."""super().__init__(message)self.message=message
def__str__(self)->str:"""Return the string representation of the exception."""returnf"{self.__class__.__name__}: {self.message}"