Skip to content

Commit e91baa5

Browse files
authored
Merge pull request #2579 from thumDer/fix/2570
fix: CLI, removed exception from ClearAllCaches
2 parents 94acb4b + 0d9a635 commit e91baa5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dev/pyRevitLabs/pyRevitLabs.PyRevit/PyRevitCaches.cs

Lines changed: 4 additions & 6 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,8 @@ 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
36-
// if it's not there, the clear cache request is technically already satisfied
37-
//else
38-
// throw new pyRevitResourceMissingException(pyRevitAppDataPath);
35+
else
36+
logger.Debug($"{PyRevitLabsConsts.PyRevitPath} directory not found, nothing to clear.");
3937
}
4038

4139
// clear all caches
@@ -50,7 +48,7 @@ public static void ClearAllCaches() {
5048
}
5149
}
5250
else
53-
throw new pyRevitResourceMissingException(PyRevitLabsConsts.PyRevitPath);
51+
logger.Debug($"{PyRevitLabsConsts.PyRevitPath} directory not found, nothing to clear.");
5452
}
5553

5654

0 commit comments

Comments
 (0)