From 84a0d81e5ec7d7e9e9446a9e2d579c7edd423270 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 31 Aug 2026 15:03:08 +0200 Subject: [PATCH] fix: Add a bit more information when unable to parse smb stat --- src/Wrapped/Parser.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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']),