Skip to content

Commit

Permalink
fix sub exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Sep 24, 2023
1 parent f209d5d commit 752fe13
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Generator/Client/LanguageBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ private function buildTags(array $grouped, DefinitionsInterface $definitions, ar
if ($value instanceof OperationInterface) {
$operations[$key] = $value;
} elseif (is_array($value)) {
$subExceptions = [];
[$subTags, $subOperations] = $this->buildTags($value, $definitions, $subExceptions, array_merge($path, [$key]));
[$subTags, $subOperations] = $this->buildTags($value, $definitions, $exceptions, array_merge($path, [$key]));

$tags[] = new Dto\Tag(
$this->naming->buildClassNameByTag(array_merge($path, [$key])),
Expand Down Expand Up @@ -194,7 +193,7 @@ private function getOperations(array $operations, DefinitionsInterface $definiti
$throwSchema = $throw->getSchema();
if ($throwSchema instanceof ReferenceType) {
$exceptionClassName = $this->naming->buildClassNameByException($throwSchema->getRef());
$exceptions[$exceptionClassName] = new Dto\Exception($exceptionClassName, $throwSchema->getRef(), 'The server returned an error');
$exceptions[$exceptionClassName] = new Dto\Exception($exceptionClassName, $this->normalizer->class($throwSchema->getRef()), 'The server returned an error');

$imports[$exceptionClassName] = $exceptionClassName;
}
Expand Down

0 comments on commit 752fe13

Please sign in to comment.