Skip to content

Commit

Permalink
Resolved #7, Undefined class Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dusta committed Sep 13, 2018
1 parent 2c834f4 commit bcb8f05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,21 @@ public function put($adapter, $tmp_name, $pathImage, $forced = false)

if ($this->manager->has($adapter . '://' . $pathImage)) {
if ($forced == false) {
throw new Exception('File Allredy Exist');
throw new \Exception('File Allredy Exist');
}

$this->manager->delete($adapter . '://' . $pathImage);
}

$stream = fopen($tmp_name, 'r+');
if (!$stream) {
throw new Exception('Failed to open uploaded file');
throw new \Exception('Failed to open uploaded file');
}

$this->manager->writeStream($adapter . '://' . $pathImage, $stream);
$put = $this->driver->put($adapter, $pathImage, $mime, $stream);
fclose($stream);
} catch (Exception $e) {
} catch (\Exception $e) {
return ['return' => false, 'response' => $e->getMessage()];
}

Expand Down

0 comments on commit bcb8f05

Please sign in to comment.