Skip to content

Commit ad609e9

Browse files
committed
Render contest validation errors more nicely. Fixes #2891
1 parent 1b1261d commit ad609e9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

webapp/src/Service/CheckConfigService.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,15 @@ public function checkContestsValidate(): ConfigCheckItem
479479

480480
$desc = '';
481481
foreach ($contesterrors as $cid => $errors) {
482-
$desc .= "Contest: c$cid: " .
483-
/* @phpstan-ignore-next-line */
484-
(count($errors) == 0 ? 'no errors' : (string)$errors) ."\n" .$cperrors[$cid];
482+
$desc .= "Contest: c$cid: ";
483+
if (count($errors) == 0) {
484+
$desc .= "no errors\n";
485+
} else {
486+
$desc .= "errors:\n";
487+
foreach ($errors as $error) {
488+
$desc .= " - " . $error->getPropertyPath() . ": " . $error->getMessage() . "\n";
489+
}
490+
}
485491
}
486492

487493
$this->stopwatch->stop(__FUNCTION__);

0 commit comments

Comments
 (0)