Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Commit f64f635

Browse files
author
Simon Warta
committed
Raise IncludeNotFoundException when include file is missing
1 parent 812fd3a commit f64f635

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clcache.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ def normalizeBaseDir(baseDir):
8484
return None
8585

8686

87+
class IncludeNotFoundException(Exception):
88+
pass
89+
90+
8791
class ManifestDoesNotExistException(Exception):
8892
pass
8993

@@ -181,7 +185,10 @@ def getManifestHash(compilerBinary, commandLine, sourceFile):
181185

182186
@staticmethod
183187
def getIncludesContentHashForFiles(listOfIncludesAbsolute):
184-
listOfIncludesHashes = [getFileHash(filepath) for filepath in listOfIncludesAbsolute]
188+
try:
189+
listOfIncludesHashes = [getFileHash(filepath) for filepath in listOfIncludesAbsolute]
190+
except FileNotFoundError as e:
191+
raise IncludeNotFoundException(e.filename)
185192
return ManifestsManager.getIncludesContentHashForHashes(listOfIncludesHashes)
186193

187194
@staticmethod

0 commit comments

Comments
 (0)