I am building a program that will move a bunch of files.
if (line.Contains("INSERT INTO BACKLOGITEM_ATTACHMENT VALUES")) { string AttachementID = line.Split(',', ')')[1]; string FileName = AttachementsDictionary[AttachementID]; string BacklogScrumID = BacklogLookupDictionary[AttachementID]; BacklogItem Story = BacklogItemDictionary[BacklogScrumID]; Product Product = ProductDictionary[Story.ProductScrumId]; string FileToCopy = "\\\\dxScrum01v\\ScrumWorksPro\\scrumworks\\data\\attachments\\product" + Story.ProductScrumId + "\\attachement" + AttachementID; string FileToSave = "C:\\ScrumWorksAttachementExport\\" + Product.ProductName + "\\" + Product.StoryPrefix + "-" + Story.StoryTitle + "\\" + FileName; //Console.WriteLine(FileToCopy + " >>> " + FileToSave); try { File.Copy(@FileToCopy, @FileToSave); } catch (Exception) { Console.WriteLine("Failed: " + FileToSave); throw; } } The issue is that I am getting an exception when running the program. There are times when the file does not exist.
How can I make it so that if it fails it just outputs the failure and keeps going? 
throwinside a catch does not get caught by the outer catch, so it will still break inside the debugger.@in front of the variables, and you should be using it when you specify the file path (to avoid double backslashes).