You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that the new StatsAPI based scoreboard code isn't handling failed HTTP requests properly.
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: Traceback (most recent call last):
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: File "/home/pi/deploy/env/bin/scoreboard", line 11, in <module>
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: load_entry_point('dowski.scoreboard', 'console_scripts', 'scoreboard')()
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: File "/home/pi/deploy/scoreboard/scoreboard/scoreboard.py", line 47, in start
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: main(sys.argv)
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: File "/home/pi/deploy/scoreboard/scoreboard/scoreboard.py", line 67, in main
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: jobs.run()
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: File "/usr/lib/python3.7/sched.py", line 151, in run
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: action(*argument, **kwargs)
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: File "/home/pi/deploy/scoreboard/scoreboard/tracker.py", line 55, in track
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: game_details = self.mlbapi.get_game_detail(scheduled_game.game_id)
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: File "/home/pi/deploy/scoreboard/scoreboard/mlb.py", line 72, in get_game_detail
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: response = statsapi.get('game', {'gamePk':game_id, 'fields':"gameData,teams,teamName,status,detailedState,liveData,linescore,home,away,runs,hits,errors,offense,outs,balls,strikes,first,second,third,currentInning,inningState"})
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: File "/home/pi/deploy/env/lib/python3.7/site-packages/MLB_StatsAPI-0.1.9-py3.7.egg/statsapi/__init__.py", line 1644, in get
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: raise ValueError("Request failed. Status Code: " + str(r.status_code) + ".")
Aug 9 20:54:03 scoreboard2 scoreboard[4695]: ValueError: Request failed. Status Code: 502.
I guess I need to handle ValueError here, although that seems like a broad exception to catch. Maybe I can submit a change upstream in StatsAPI that indicates more clearly that the error is at the HTTP level.
The text was updated successfully, but these errors were encountered:
I think that the new StatsAPI based scoreboard code isn't handling failed HTTP requests properly.
I guess I need to handle
ValueError
here, although that seems like a broad exception to catch. Maybe I can submit a change upstream in StatsAPI that indicates more clearly that the error is at the HTTP level.The text was updated successfully, but these errors were encountered: