Skip to content

Commit 671c00a

Browse files
committed
removed exception from ClearAllCaches
1 parent 30fc6f1 commit 671c00a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitCaches.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace pyRevitLabs.PyRevit {
1818
public static class PyRevitCaches {
1919
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
2020

21-
// pyrevit cache folder
21+
// pyrevit cache folder
2222
// @reviewed
2323
public static string GetCacheDirectory(int revitYear) {
2424
return Path.Combine(PyRevitLabsConsts.PyRevitPath, revitYear.ToString());
@@ -32,10 +32,11 @@ public static void ClearCache(int revitYear) {
3232
RevitController.KillRunningRevits(revitYear);
3333
CommonUtils.DeleteDirectory(GetCacheDirectory(revitYear));
3434
}
35-
// it's just clearing caches. Let's not be paranoid and throw an exception is directory does not exist
35+
else
36+
// it's just clearing caches. Let's not be paranoid and throw an exception if directory does not exist
3637
// if it's not there, the clear cache request is technically already satisfied
37-
//else
3838
// throw new pyRevitResourceMissingException(pyRevitAppDataPath);
39+
Console.WriteLine($"{PyRevitLabsConsts.PyRevitPath} directory not found, nothing to clear.");
3940
}
4041

4142
// clear all caches
@@ -50,7 +51,7 @@ public static void ClearAllCaches() {
5051
}
5152
}
5253
else
53-
throw new pyRevitResourceMissingException(PyRevitLabsConsts.PyRevitPath);
54+
Console.WriteLine($"{PyRevitLabsConsts.PyRevitPath} directory not found, nothing to clear.");
5455
}
5556

5657

0 commit comments

Comments
 (0)