Skip to content

Error Message

Class which handles the error message the spotify exceptions use

ErrorMessage

The error message

Source code in async_spotify/_error_message.py
class ErrorMessage(object):
    """The error message"""

    def __init__(self, status: int = 0, message: str = ''):
        """
        Create a Error message object which will be used internally by the spotify exceptions

        Args:
            status: The http status code (0 if not applicable)
            message: The error message
        """
        self.message = message
        self.status = status

    @property
    def __dict__(self) -> Dict[str, Dict[str, str]]:
        """
        Returns: The error message which can is used by the spotify exceptions
        """
        return {'error': {'status': self.status, 'message': self.message}}

__init__(self, status=0, message='') special

Create a Error message object which will be used internally by the spotify exceptions

Parameters:

Name Type Description Default
status int

The http status code (0 if not applicable)

0
message str

The error message

''
Source code in async_spotify/_error_message.py
def __init__(self, status: int = 0, message: str = ''):
    """
    Create a Error message object which will be used internally by the spotify exceptions

    Args:
        status: The http status code (0 if not applicable)
        message: The error message
    """
    self.message = message
    self.status = status

Last update: August 28, 2020