Topic

API returns invalid JSON

I know I probably shouldn't be fiddling with the API yet, but putting that small detail aside for a moment:

The game servers just had a case of the bad JooJoos and while that was happening, players.inventory was returning invalid JSON - caused by the inclusion of a PHP error message:


Warning: Invalid argument supplied for foreach() in /var/www/html/prod/api/api_players.php on line 72
{
"contents": {},
"ok": 1
}

Two things really:

- a production server shouldn't really be sending those kind of error messages back to the client
- if the game servers are down, I'd expect a non-ok response from the API.

Posted 13 years ago by dopiaza Subscriber! | Permalink