src/sagemaker_algorithm_toolkit/exceptions.py
def _format_exception_message(message, caused_by):
        """Generates the exception message.

        If a message has been explicitly passed then we use that as the exception
        message. If we also know the underlying exception type we prepend that
        to the name.

        If there is no message but we have an underlying exception then we use
        that exceptions message and prepend the type of the exception.
        """
        if message:
            formatted_message = message
        elif caused_by:
            with warnings.catch_warnings():
                warnings.simplefilter("ignore")  # Suppress deprecation warning
                formatted_message = getattr(caused_by, 'message', str(caused_by))
        else:
            formatted_message = "unknown error occurred"

        if caused_by:
            formatted_message += " (caused by {})".format(caused_by.__class__.__name__)

        return formatted_message
Generates the exception message.

        If a message has been explicitly passed then we use that as the exception
        message. If we also know the underlying exception type we prepend that
        to the name.

        If there is no message but we have an underlying exception then we use
        that exceptions message and prepend the type of the exception.
        
Generates the exception message.
If a message has been explicitly passed then we use that as the exception
message. If we also know the underlying exception type we prepend that
to the name.

If there is no message but we have an underlying exception then we use
that exceptions message and prepend the type of the exception.
Generates the exception message . If a message has been explicitly passed then we use that as the exception message . If we also know the underlying exception type we prepend that to the name . If there is no message but we have an underlying exception then we use that exceptions message and prepend the type of the exception .
def _format_exception_message(message, caused_by):
        if message:
            formatted_message = message
        elif caused_by:
            with warnings.catch_warnings():
                warnings.simplefilter("ignore")  
                formatted_message = getattr(caused_by, 'message', str(caused_by))
        else:
            formatted_message = "unknown error occurred"
        if caused_by:
            formatted_message += " (caused by {})".format(caused_by.__class__.__name__)
        return formatted_message
def _format_exception_message ( message , caused_by ) : if message : formatted_message = message elif caused_by : with warnings . catch_warnings ( ) : warnings . simplefilter ( "ignore" ) formatted_message = getattr ( caused_by , 'message' , str ( caused_by ) ) else : formatted_message = "unknown error occurred" if caused_by : formatted_message += " (caused by {})" . format ( caused_by . __class__ . __name__ ) return formatted_message
Generates the exception message.
Generates the exception message .
"""Generates the exception message.

        If a message has been explicitly passed then we use that as the exception
        message. If we also know the underlying exception type we prepend that
        to the name.

        If there is no message but we have an underlying exception then we use
        that exceptions message and prepend the type of the exception.
        """ # Suppress deprecation warning
message
caused_by