logger->error($exception->getMessage(), [ 'app' => $this->appName, 'exception' => $exception, ]); if ($exception instanceof HintException) { $message = $exception->getHint(); } else { $message = $exception->getMessage(); } return new JSONResponse( ['message' => $message], Http::STATUS_BAD_REQUEST ); } }