Skip to content

Commit 410c384

Browse files
committed
update samples
1 parent dca7c36 commit 410c384

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

samples/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use JMS\Serializer\Visitor\Factory\XmlDeserializationVisitorFactory;
1010
use DateTime;
1111
use RuntimeException;
12+
use JMS\Serializer\Exception\RuntimeException as SerializerRuntimeException;
1213

1314
class JmsSerializer implements SerializerInterface
1415
{
@@ -122,7 +123,7 @@ private function deserializeString($data, string $type)
122123

123124
$enum = $type::tryFrom($data);
124125
if (!$enum) {
125-
throw new RuntimeException(sprintf("Unknown %s value in %s enum", $data, $type));
126+
throw new SerializerRuntimeException(sprintf("Unknown %s value in %s enum", $data, $type));
126127
}
127128

128129
return $enum;

0 commit comments

Comments
 (0)