diff --git a/src/Exception/PackingFailedException.php b/src/Exception/PackingFailedException.php index 682a497..f2e6fdd 100644 --- a/src/Exception/PackingFailedException.php +++ b/src/Exception/PackingFailedException.php @@ -18,7 +18,7 @@ class PackingFailedException extends \RuntimeException */ public static function unsupportedType($value) : self { - return new self(\sprintf('Unsupported type "%s", maybe you forgot to register the type transformer?', + return new self(\sprintf('Unsupported type "%s", maybe you forgot to register the type transformer or extension?', \is_object($value) ? \get_class($value) : \gettype($value) )); } diff --git a/tests/Unit/PackerTest.php b/tests/Unit/PackerTest.php index 6a536ae..9b0aaad 100644 --- a/tests/Unit/PackerTest.php +++ b/tests/Unit/PackerTest.php @@ -47,7 +47,9 @@ public function testPack($raw, string $packed) : void public function testPackThrowsExceptionOnUnsupportedType($value, string $type) : void { $this->expectException(PackingFailedException::class); - $this->expectExceptionMessage("Unsupported type \"$type\", maybe you forgot to register the type transformer?"); + $this->expectExceptionMessage( + "Unsupported type \"$type\", maybe you forgot to register the type transformer or extension?" + ); $this->packer->pack($value); } @@ -183,7 +185,9 @@ public function testPackThrowsExceptionOnUnsupportedCustomType() : void $packer = $this->packer->extendWith($transformer); $this->expectException(PackingFailedException::class); - $this->expectExceptionMessage('Unsupported type "stdClass", maybe you forgot to register the type transformer?'); + $this->expectExceptionMessage( + 'Unsupported type "stdClass", maybe you forgot to register the type transformer or extension?' + ); $packer->pack($obj); }