protected function validateTaskResult(Result $result)
    {
        if ($result->getExitCode() !== Result::EXITCODE_OK) {
            throw new TaskResultRuntimeException($result);
        }

        return $result;
    }