improve s3key exception (#661)

This commit is contained in:
Chirag Chhatrala
2025-01-06 17:22:20 +05:30
committed by GitHub
parent 5bc0d3ccc8
commit b0311257ac

View File

@@ -42,7 +42,7 @@ class S3KeyCleaner
}
if (!$objectKey || (!is_string($objectKey) && !is_numeric($objectKey))) {
throw new \Exception("Expected non-empty string or number, got ${objectKey}");
throw new \Exception("Invalid object key: Expected non-empty string or number, received " . (is_object($objectKey) ? get_class($objectKey) : gettype($objectKey)));
}
if (is_numeric($objectKey)) {