Skip to content

Commit 20b7251

Browse files
committed
Catch error when can't find caches.json file in resource path
1 parent 39e646c commit 20b7251

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

stashcp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,10 @@ def get_best_stashcache():
558558
os.path.join(prefix, "etc/stashcache/caches.json"),
559559
os.path.join(prefix, "usr/share/stashcache/caches.json")]
560560
if resource_string:
561-
cache_files.insert(0, resource_string(__name__, 'caches.json'))
561+
try:
562+
cache_files.insert(0, resource_string(__name__, 'caches.json'))
563+
except IOError as ioe:
564+
logging.debug("Unable to retrieve caches.json using resource string, trying other locations")
562565

563566
for cache_file in cache_files:
564567
if os.path.isfile(cache_file):

0 commit comments

Comments
 (0)