Skip to content

Commit

Permalink
Fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
gplcart committed Feb 15, 2018
1 parent 9dd76f8 commit 261a198
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions handlers/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

namespace gplcart\modules\image\handlers;

use claviska\SimpleImage;
use Exception;
use gplcart\core\Library;
use gplcart\core\exceptions\Dependency as DependencyException;
use LogicException;

/**
* Image action methods for Image module
Expand All @@ -27,17 +28,17 @@ class Action

/**
* @param Library $library
* @throws DependencyException
* @throws LogicException
*/
public function __construct(Library $library)
{
$library->load('simpleimage');

if(!class_exists('claviska\\SimpleImage')){
throw new DependencyException('Class claviska\\SimpleImage does not exist');
if (!class_exists('claviska\\SimpleImage')) {
throw new LogicException('Class claviska\\SimpleImage does not exist');
}

$this->image = new \claviska\SimpleImage;
$this->image = new SimpleImage;
}

/**
Expand Down

0 comments on commit 261a198

Please sign in to comment.