Closed davidwisniowski closed 4 years ago
Now i use the same json context in the method chain.
Also i have removed the optional return type from the public methods. The Magic happens in the new private method retrieveGameIdFromStream where i check: user is streaming and if yes: return optional of game id.
based on this optional i throw the: user is not streaming exception in the public method: retrieveCurrentPlayingGameByUserId
The Calling User can Catch the Twitch API Exception("User not exists or not streaming at the moment.")
Maybe we could introduce here another type exception. NotStreamingException for example to have different exception types.