1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 09:54:17 +02:00

debug parse errors

This commit is contained in:
Robin Appelman 2017-10-25 00:52:25 +02:00
commit d02efa2803

View file

@ -52,7 +52,7 @@ class Parser {
$players = [];
if (!isset($data['rounds'])) {
throw new \Exception('Error while parsing demo, no users rounds found');
throw new \Exception("Error while parsing demo, no rounds field found\n" . json_encode($data));
}
foreach ($data['rounds'] as $round) {
if ($round['winner'] === 'red') {
@ -63,7 +63,7 @@ class Parser {
}
if (!isset($data['chat'])) {
throw new \Exception('Error while parsing demo, no users chat found');
throw new \Exception('Error while parsing demo, no chat field found');
}
foreach ($data['chat'] as $message) {
if (isset($message['from'])) {