How to call Catch if boolean value is false or my condition not return any values?
<p>Am just wondering how to workaround my scenario,here is my code</p>

<pre><code> try
            {
                bool b;
                foreach (string file in files)
                {

                    #region donloadfiles
                    if (b = file.Contains(story))
                    {
                        try
                        {
                            logger.Info("calling xml creation Method");
                            baseMeta(story, XML);
                            logger.Info("XML created");
                        }
                        catch (Exception ex)
                        { logger.Error(ex.Message); throw; }

                        logger.Info("calling Download Method");
                        Download(file, story, xml, program);
                        logger.Info("Download Method processed successfully");
                    }
                    #endregion
                }


            }

            catch (Exception ex)
            { logger.Error(ex.Message); throw; }
</code></pre>

<p>As promised,here is my main method contains try catch block</p>

<pre><code> try
            {

                //update the status here in DB
               Status = "Closed";
               Update(status);
            }

            catch (Exception ex)
            {

                Status = "Failed";
                Update(status);
                break;
            }
</code></pre>

<p>i have directory "for eg:C:\" my getlist method grab all the record and pass it to my foreach loop "foreach (string file in files)" then i have a condition</p>

<p>if (b = file.Contains(story)) to check any of my file have the name "story" then do some logic inside.this thing works good.</p>

<p>Now what am trying to do is,if none of the files are matching then i have to forcefully call the catch and throw to the main catch,am doing some logic update in my main catch.</p>

<p>Someone please advice me how can i workaround this scenario.</p>

<p>Thanks in advance</p>
