victorwrotethis / streamer-endpoints

Rest endpoints meant for usage with nightbot in twitch
MIT License
0 stars 1 forks source link

feature/user-is-not-streaming #15

Closed davidwisniowski closed 4 years ago

davidwisniowski commented 4 years ago

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.

davidwisniowski commented 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