Skip to content

Commit

Permalink
Extract variable
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Aug 20, 2024
1 parent e580161 commit ca3fa36
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Codegen/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ public static function validate(Schema $schema, DocumentNode $document): void
static fn (Error $error): array => FormattedError::createFromException($error, DebugFlag::INCLUDE_DEBUG_MESSAGE),
$errors
);

$errorStrings = array_map(
static fn (array $error): string => \Safe\json_encode($error),
$formattedErrors
);
$errorMessage = implode("\n\n", $errorStrings);

throw new \Exception(
implode("\n\n", $errorStrings)
);
throw new \Exception($errorMessage);
}
}

0 comments on commit ca3fa36

Please sign in to comment.