Der Fehler kann abgefangen werden, ähnlich read()

This commit is contained in:
2021-04-07 12:08:37 +02:00
parent 60eb1f92e8
commit 3e2865dbe7
@@ -69,13 +69,17 @@ class WorkingHoursController
*
* @return Response
*
* @throws Exception
* @throws HttpInternalServerErrorException
* @noinspection PhpUnusedParameterInspection
*/
public function browse(Request $request, Response $response, array $args): Response
{
$repository = new WorkingHoursRepository($this->databases);
return $this->printResponse($response, $repository->findAll(), StatusCodeInterface::STATUS_OK);
try {
return $this->printResponse($response, $repository->findAll(), StatusCodeInterface::STATUS_OK);
} catch (Exception $exception) {
throw new HttpInternalServerErrorException($request, 'Der Wert für das Datum oder die Zeit ist falsch in der Datenbank', $exception);
}
}
/**