mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-17 16:26:51 +03:00
add a specific exception for invalid UUID string
This commit is contained in:
@@ -16,6 +16,7 @@ namespace Ramsey\Uuid\Codec;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Ramsey\Uuid\Builder\UuidBuilderInterface;
|
||||
use Ramsey\Uuid\Exception\InvalidUuidStringException;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
|
||||
@@ -139,7 +140,7 @@ class StringCodec implements CodecInterface
|
||||
$nameParsed = implode('-', $components);
|
||||
|
||||
if (!Uuid::isValid($nameParsed)) {
|
||||
throw new InvalidArgumentException('Invalid UUID string: ' . $encodedUuid);
|
||||
throw new InvalidUuidStringException('Invalid UUID string: ' . $encodedUuid);
|
||||
}
|
||||
|
||||
return $components;
|
||||
|
||||
Reference in New Issue
Block a user