diff --git a/src/Wrapped/Parser.php b/src/Wrapped/Parser.php index bec5747..590165f 100644 --- a/src/Wrapped/Parser.php +++ b/src/Wrapped/Parser.php @@ -154,9 +154,13 @@ final class Parser { $data[$name] = $value; } } - $attributeStart = strpos($data['attributes'], '('); + $attributeStart = isset($data['attributes']) ? strpos($data['attributes'], '(') : false; if ($attributeStart === false) { - throw new Exception("Malformed state response from server"); + throw new Exception(sprintf( + "Malformed state response from server, attributes field %s: %s", + isset($data['attributes']) ? "'" . $data['attributes'] . "'" : 'missing', + implode("\n", $output) + )); } return [ 'mtime' => (int)strtotime($data['write_time']),