Skip to content
This repository has been archived by the owner on Mar 20, 2020. It is now read-only.

Commit

Permalink
/server/playerdata.json: suppress FileNotFoundError
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Aug 12, 2015
1 parent 6e0c42d commit 5ef7a5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is version 1.17.1 of the API ([semver](http://semver.org/)). A list of avai
Requirements
============

* [Python](http://python.org/) 3.2
* [Python](http://python.org/) 3.4
* [Pillow](http://pypi.python.org/pypi/Pillow) 2.5 (required for image-producing endpoints only)
* [bottle](http://bottlepy.org/) 0.12
* [mcstatus](https://github.com/Dinnerbone/mcstatus) (required for `/server/status.json` only)
Expand Down
4 changes: 3 additions & 1 deletion api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import bottle
import collections
import contextlib
from datetime import datetime
import io
import json
Expand Down Expand Up @@ -512,7 +513,8 @@ def api_player_data_all():
"""Returns the player data of all whitelisted players, encoded as JSON"""
nbtdicts = {}
for user in playernames():
nbtdata = api_player_data(user)
with contextlib.suppress(FileNotFoundError):
nbtdata = api_player_data(user)
nbtdicts[user] = nbtdata
return nbtdicts

Expand Down

0 comments on commit 5ef7a5a

Please sign in to comment.