mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Removal of deprecated methods and addition of information in TikTokLiveUnknownHostException and TikTokLiveOfflineHostException!
This commit is contained in:
@@ -114,10 +114,10 @@ public class TikTokLiveClient implements LiveClient
|
||||
roomInfo.setRoomId(userData.getRoomId());
|
||||
|
||||
if (userData.getUserStatus() == LiveUserData.UserStatus.Offline)
|
||||
throw new TikTokLiveOfflineHostException("User is offline: " + roomInfo.getHostName());
|
||||
throw new TikTokLiveOfflineHostException("User is offline: " + roomInfo.getHostName(), userData, null);
|
||||
|
||||
if (userData.getUserStatus() == LiveUserData.UserStatus.NotFound)
|
||||
throw new TikTokLiveUnknownHostException("User not found: " + roomInfo.getHostName());
|
||||
throw new TikTokLiveUnknownHostException("User not found: " + roomInfo.getHostName(), userData, null);
|
||||
|
||||
var liveDataRequest = new LiveData.Request(userData.getRoomId());
|
||||
var liveData = httpClient.fetchLiveData(liveDataRequest);
|
||||
@@ -126,10 +126,10 @@ public class TikTokLiveClient implements LiveClient
|
||||
throw new TikTokLiveException("Livestream for " + roomInfo.getHostName() + " is 18+ or age restricted!");
|
||||
|
||||
if (liveData.getLiveStatus() == LiveData.LiveStatus.HostNotFound)
|
||||
throw new TikTokLiveUnknownHostException("LiveStream for " + roomInfo.getHostName() + " could not be found.");
|
||||
throw new TikTokLiveUnknownHostException("LiveStream for " + roomInfo.getHostName() + " could not be found.", userData, liveData);
|
||||
|
||||
if (liveData.getLiveStatus() == LiveData.LiveStatus.HostOffline)
|
||||
throw new TikTokLiveOfflineHostException("LiveStream for " + roomInfo.getHostName() + " not found, is the Host offline?");
|
||||
throw new TikTokLiveOfflineHostException("LiveStream for " + roomInfo.getHostName() + " not found, is the Host offline?", userData, liveData);
|
||||
|
||||
roomInfo.setTitle(liveData.getTitle());
|
||||
roomInfo.setViewersCount(liveData.getViewers());
|
||||
|
||||
Reference in New Issue
Block a user