Browse Source

Throw an exception when a file does not exist

pull/3/head
Richard Dern 4 months ago
parent
commit
33aa5bc613
  1. 5
      package/Analyzer.php

5
package/Analyzer.php

@ -8,6 +8,7 @@ use Cyca\Fetcher\Facades\Fetcher;
use Cyca\Helpers\Helpers\GenericObject;
use Exception;
use Illuminate\Contracts\Filesystem\Filesystem;
use League\Flysystem\FileNotFoundException;
/**
* Analyze a document
@ -168,6 +169,10 @@ class Analyzer extends GenericObject
throw new Exception("You need to define a filesystem before analyzing a file");
}
if (!$this->fileSystem->exists($file)) {
throw new FileNotFoundException($file);
}
$this->runAnalyzis();
if ($deleteAfter) {

Loading…
Cancel
Save