ProcessQuery() private method

private ProcessQuery ( Stream outputStream = null ) : void
outputStream Stream
return void
        public static void Main(string[] args)
        {
            if (!GetArgs(args))
            {
                PrintUsage();
                Environment.ExitCode = 1;
                return;
            }

            try {
                OpenSearchClient client = new OpenSearchClient();

                client.Initialize();

                if (listEncoding == true)
                {
                    client.ListOpenSearchEngineExtensions();
                }
                else if (baseUrlArg != null)
                {
                    if (descriptionArg == null)
                    {
                        client.ProcessQuery();
                    }
                    else
                    {
                        client.PrintOpenSearchDescription(descriptionArg);
                    }
                }

                if (!string.IsNullOrEmpty(queryModelArg) && baseUrlArg == null)
                {
                    client.PrintDataModelHelp(DataModel.CreateFromArgs(queryModelArg, new NameValueCollection()));
                }
            } catch (AggregateException ae) {
                foreach (Exception e in ae.InnerExceptions)
                {
                    LogError(e, true);
                }

                Environment.ExitCode = 1;
                return;
            } catch (PartialAtomException) {
                Environment.ExitCode = 18;
                searchCache.ClearCache(".*", DateTime.Now);
                return;
            } catch (TimeoutException e) {
                LogError(e);
                Environment.ExitCode = 124;
                return;
            } catch (Exception e) {
                LogError(e, verbose);
                Environment.ExitCode = 1;
                return;
            }
        }
        public static void Main(string[] args)
        {
            if (!GetArgs(args))
            {
                PrintUsage();
                Environment.ExitCode = 1;
                return;
            }

            OpenSearchClient client = null;
            try
            {
                client = new OpenSearchClient();

                client.Initialize();

                if (baseUrlArg != null)
                    client.ProcessQuery();

                if (listOsee == true)
                    client.ListOpenSearchEngineExtensions();

                if (!string.IsNullOrEmpty(queryModelArg) && baseUrlArg == null)
                {
                    client.PrintDataModelHelp(DataModel.CreateFromArgs(queryModelArg, new NameValueCollection()));
                }

            }
            catch (AggregateException ae)
            {
                foreach (var e in ae.InnerExceptions)
                {
                    Console.Error.WriteLine(string.Format("{0} : {1} {2}", e.ToString(), e.Message, e.HelpLink));
                    if (verbose)
                        Console.Error.WriteLine(e.StackTrace);
                }
                Environment.ExitCode = 1;
                return;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(string.Format("{0} : {1} {2}", e.Source, e.Message, e.HelpLink));
                if (verbose)
                    Console.Error.WriteLine(e.StackTrace);
                Environment.ExitCode = 1;
                return;
            }
        }