Managed error while generating URL previews by throwing an exception

This commit is contained in:
Alejandro Celaya
2016-08-18 11:16:56 +02:00
parent 277406c3b8
commit 60c68c914b
6 changed files with 48 additions and 4 deletions

View File

@@ -0,0 +1,10 @@
<?php
namespace Shlinkio\Shlink\Common\Exception;
class PreviewGenerationException extends RuntimeException
{
public static function fromImageError($error)
{
return new self(sprintf('Error generating a preview image with error: %s', $error));
}
}