public function getTaskAction($taskId, Request $request)
    {
        // Retrieve the status file of the task.
        $task   = $this->getTensideTasks()->getTask($taskId);
        $offset = null;

        if (!$task) {
            throw new NotFoundHttpException('No such task.');
        }

        if ($request->query->has('offset')) {
            $offset = (int) $request->query->get('offset');
        }

        return $this->createJsonResponse([$this->convertTaskToArray($task, true, $offset)]);
    }