Skip to content

Commit de0e510

Browse files
authored
Add BlockSizeTooSmallException (#471)
1 parent d22bf31 commit de0e510

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Endroid\QrCode\Exception;
6+
7+
final class BlockSizeTooSmallException extends \Exception
8+
{
9+
}

src/Matrix/Matrix.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Endroid\QrCode\Matrix;
66

7+
use Endroid\QrCode\Exception\BlockSizeTooSmallException;
78
use Endroid\QrCode\RoundBlockSizeMode;
89

910
final readonly class Matrix implements MatrixInterface
@@ -43,7 +44,7 @@ public function __construct(
4344
}
4445

4546
if ($blockSize < 1) {
46-
throw new \Exception('Too much data: increase image dimensions or lower error correction level');
47+
throw new BlockSizeTooSmallException('Too much data: increase image dimensions or lower error correction level');
4748
}
4849

4950
$this->blockSize = $blockSize;

0 commit comments

Comments
 (0)