def get_error_msg(exception):
    """
    Get the message from an exception
    :param exception: error/exception to get teh message
    :return: error message
    """
    exception_repr = exception.__class__.__name__

    try:
        message = exception.args[0]
        return message if isinstance(message, str) else exception_repr
    except (AttributeError, IndexError):
        return exception_repr