Merge pull request #799 from kebby/master
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / RemoveDir.cs
index d8783035251c7644de5db35bc00943e4891909af..00755fc449666dea161d6df4359bd5751acaba99 100644 (file)
@@ -52,26 +52,11 @@ namespace Microsoft.Build.Tasks {
                        
                        foreach (ITaskItem directory in directories) {
                                try {
-                                       Directory.Delete (directory.GetMetadata ("FullPath"), true);
-                                       temporaryRemovedDirectories.Add (directory);
-                               }
-                               catch (DirectoryNotFoundException ex) {
-                                       Log.LogErrorFromException (ex);
-                               }
-                               catch (PathTooLongException ex) {
-                                       Log.LogErrorFromException (ex);
-                               }
-                               catch (ArgumentNullException ex) {
-                                       Log.LogErrorFromException (ex);
-                               }
-                               catch (ArgumentException ex) {
-                                       Log.LogErrorFromException (ex);
-                               }
-                               catch (IOException ex) {
-                                       Log.LogErrorFromException (ex);
-                               }
-                               catch (SecurityException ex) {
-                                       Log.LogErrorFromException (ex);
+                                       string fullpath = directory.GetMetadata ("FullPath");
+                                       if (Directory.Exists (fullpath)) {
+                                               Directory.Delete (fullpath, true);
+                                               temporaryRemovedDirectories.Add (directory);
+                                       }
                                }
                                catch (Exception ex) {
                                        Log.LogErrorFromException (ex);