mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
debug parse errors
This commit is contained in:
parent
6fb22bbbc0
commit
d02efa2803
1 changed files with 2 additions and 2 deletions
|
|
@ -52,7 +52,7 @@ class Parser {
|
||||||
$players = [];
|
$players = [];
|
||||||
|
|
||||||
if (!isset($data['rounds'])) {
|
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) {
|
foreach ($data['rounds'] as $round) {
|
||||||
if ($round['winner'] === 'red') {
|
if ($round['winner'] === 'red') {
|
||||||
|
|
@ -63,7 +63,7 @@ class Parser {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($data['chat'])) {
|
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) {
|
foreach ($data['chat'] as $message) {
|
||||||
if (isset($message['from'])) {
|
if (isset($message['from'])) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue