protected function handleException(EditorExceptionInterface $exception)
    {
        if ($this->getParameter('kernel.debug')) {
            throw $exception;
        }

        return $this->buildResponse([
            'error' => $exception->getMessage(),
        ]);
    }