Skip to content

Commit b13a771

Browse files
Unify exceptions into one.
1 parent 2cd5169 commit b13a771

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

webapp/src/Controller/API/ProblemController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ public function addProblemsAction(Request $request): array
105105
if ($this->importExportService->importProblemsData($contest, $data, $ids, $messages)) {
106106
return $ids;
107107
}
108+
$message = "Error while adding problems";
108109
if (!empty($messages)) {
109-
throw new BadRequestHttpException($this->dj->jsonEncode($messages));
110+
$message .= ': ' . $this->dj->jsonEncode($messages);
110111
}
111-
throw new BadRequestHttpException("Error while adding problems");
112+
throw new BadRequestHttpException($message);
112113
}
113114

114115
/**

0 commit comments

Comments
 (0)