Skip to content

Commit 3933f0d

Browse files
committed
Throw proper exceptions
1 parent b47351b commit 3933f0d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Method/Command/GnuGzip.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function extract($file, $target, Format\FormatInterface $format)
3737

3838
$exitCode = $this->executeCommand($command);
3939

40-
if (1 === $exitCode) {
40+
if ($exitCode > 0) {
4141
throw new FileCorruptedException($file);
4242
}
4343

src/Method/Extension/Rar.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Distill\Method\Extension;
1313

14+
use Distill\Exception\IO\Input\FileCorruptedException;
1415
use Distill\Format;
1516
use Distill\Method\AbstractMethod;
1617
use Distill\Method\MethodInterface;
@@ -32,7 +33,7 @@ public function extract($file, $target, Format\FormatInterface $format)
3233
$rar = @\RarArchive::open($file);
3334

3435
if (false === $rar) {
35-
return false;
36+
throw new FileCorruptedException($file, FileCorruptedException::SEVERITY_HIGH);
3637
}
3738

3839
$this->getFilesystem()->mkdir($target);

0 commit comments

Comments
 (0)