fix: Add a bit more information when unable to parse smb stat

This commit is contained in:
Carl Schwan 2026-08-31 15:03:08 +02:00 • committed by Robin Appelman
commit 84a0d81e5e

View file

@ -154,9 +154,13 @@ final class Parser {
$data[$name] = $value; $data[$name] = $value;
} }
} }
$attributeStart = strpos($data['attributes'], '('); $attributeStart = isset($data['attributes']) ? strpos($data['attributes'], '(') : false;
if ($attributeStart === 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 [ return [
'mtime' => (int)strtotime($data['write_time']), 'mtime' => (int)strtotime($data['write_time']),