Skip to content

Commit

Permalink
Fix Exception and replace it by InvalidArgumentException
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysalvat committed Jul 18, 2014
1 parent 904f4ab commit 00b139c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Image2Css/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function setColorType($type)
if ($type !== \Image2Css\Converter::HEXA
&& $type !== \Image2Css\Converter::RGBA
&& $type !== \Image2Css\Converter::BEST) {
throw new Exception('Color type not allowed.');
throw new \InvalidArgumentException('Color type not allowed.');
}
$this->color_type = $type;
}
Expand Down Expand Up @@ -123,10 +123,10 @@ public function load($filename)
$this->image = imagecreatefrompng($filename);
break;
default:
throw new Exception('Image Type not allowed.');
throw new \InvalidArgumentException('Image Type not allowed.');
}
} else {
throw new Exception('The file must be a valid image.');
throw new \InvalidArgumentException('The file must be a valid image.');
}
}

Expand Down

0 comments on commit 00b139c

Please sign in to comment.