Skip to content

Commit 63601da

Browse files
Fix KmlException in kmz class
1 parent 6904e7c commit 63601da

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/KmzExtractor.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace PlinCode\KmlParser;
44

5+
use PlinCode\KmlParser\Exceptions\KmlException;
56
use PlinCode\KmlParser\Exceptions\KmzExtractorException;
67
use ZipArchive;
78

@@ -46,19 +47,19 @@ public function extractKmlContent(string $path): string
4647
}
4748

4849
/**
49-
* Extract all files from KMZ to a directory
50+
* Extract all files from KMZ archive
5051
*
51-
* @throws Exception
52+
* @throws KmlException If the KMZ file cannot be found or opened
5253
*/
5354
public function extractAllFiles(string $kmzPath, string $destination): array
5455
{
5556
if (! file_exists($kmzPath)) {
56-
throw new Exception("KMZ file not found: {$kmzPath}");
57+
throw new KmlException("KMZ file not found: {$kmzPath}");
5758
}
5859

5960
$zip = new ZipArchive;
6061
if ($zip->open($kmzPath) !== true) {
61-
throw new Exception("Unable to open KMZ file: {$kmzPath}");
62+
throw new KmlException("Unable to open KMZ file: {$kmzPath}");
6263
}
6364

6465
if (! file_exists($destination)) {

0 commit comments

Comments
 (0)