/** * Builds the error message to send back when there is an error * * @fixme Missing translation * * @param ServiceException $exception * @param Folder $folder * * @return array <null|array<string,string>,bool> * @internal param $array <string,bool> $configItems * */ private function buildErrorMessage($exception, $folder) { $configPath = $this->environment->getPathFromVirtualRoot($folder); $errorMessage = $exception->getMessage() . "</br></br>Config location: /{$configPath}"; $this->logger->error($errorMessage); $config = ['error' => ['message' => $errorMessage]]; $configItems = $this->configItems; foreach ($configItems as $key => $complete) { $configItems[$key] = true; } $this->configItems = $configItems; return [$config]; }
/** * Returns an error message instead of a proper features list * * @return array */ private function mockConfigRetrievalError() { $exception = new ServiceException('Config corrupt'); $errorMessage = $exception->getMessage() . "</br></br>Config location: /user1"; $features = ['error' => ['message' => $errorMessage]]; $this->mockFeaturesList($features); return $features; }