diff --git a/src/Manager.php b/src/Manager.php index 8296677..c5c9ace 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -23,6 +23,8 @@ use SplFileObject; use Symfony\Component\HttpFoundation\File\UploadedFile; +use Throwable; + use function clearstatcache; use function copy; use function fclose; @@ -96,7 +98,7 @@ public function upload(SplFileInfo $splFileInfo): File { try { $handledSplFile = $this->handleSplFile($splFileInfo); - } catch (ErrorException $exception) { + } catch (Throwable $exception) { throw new UnableToUpload($splFileInfo, $exception); } @@ -231,7 +233,7 @@ public function write(MutableFile $file, SplFileInfo $splFileInfo): void try { $splFileInfo = $this->handleSplFile($splFileInfo); - } catch (ErrorException $exception) { + } catch (Throwable $exception) { throw FileException::unableToWrite($file, $exception); } @@ -281,7 +283,7 @@ public function clear(): void } /** - * @throws ErrorException + * @throws Throwable */ private function handleSplFile(SplFileInfo $file): SplFileInfo {