Skip to content

Commit c4d2e17

Browse files
authored
Merge pull request #1304 from greg0ire/preserve_previous_exception
Preserve previous exception
2 parents 4fffea6 + 7c6e958 commit c4d2e17

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Bridge/Symfony/Routing/IriConverter.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,15 @@ public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface
9999

100100
return $this->router->generate($routeName, ['id' => implode(';', $identifiers)], $referenceType);
101101
} catch (RuntimeException $e) {
102-
throw new InvalidArgumentException(sprintf('Unable to generate an IRI for the item of type "%s"', $resourceClass));
102+
throw new InvalidArgumentException(sprintf(
103+
'Unable to generate an IRI for the item of type "%s"',
104+
$resourceClass
105+
), $e->getCode(), $e);
103106
} catch (RoutingExceptionInterface $e) {
104-
throw new InvalidArgumentException(sprintf('Unable to generate an IRI for the item of type "%s"', $resourceClass));
107+
throw new InvalidArgumentException(sprintf(
108+
'Unable to generate an IRI for the item of type "%s"',
109+
$resourceClass
110+
), $e->getCode(), $e);
105111
}
106112
}
107113

0 commit comments

Comments
 (0)