class PMSError(Exception):
    code = "pms_error"

    def __init__(self, message=None):
        super().__init__(message or self.code)
        self.message = message or self.code


class PMSUnavailable(PMSError):
    code = "pms_unavailable"


class PMSTokenExpired(PMSError):
    code = "expired_token"


class PMSInvalidRoom(PMSError):
    code = "invalid_room"


class PMSNoCheckedInGuest(PMSError):
    code = "no_checked_in_guest"


class PMSChargeFailed(PMSError):
    code = "failed_room_charge"


class PMSDuplicateCharge(PMSError):
    code = "duplicate_charge"


class PMSNetworkTimeout(PMSError):
    code = "network_timeout"


class PMSConfigurationRequired(PMSError):
    code = "configuration_required"
