Add a cause message to the StopBuild exception.

This commit is contained in:
Matthieu Gautier 2019-09-04 14:56:08 +02:00
parent 0f13d99159
commit d86bf75315
2 changed files with 8 additions and 3 deletions

View File

@ -204,6 +204,7 @@ class Builder:
platform.clean_intermediate_directories()
else:
print("SKIP")
except StopBuild:
except StopBuild as e:
print(e)
sys.exit("Stopping build due to errors")

View File

@ -127,7 +127,7 @@ def download_remote(what, where):
print('Sha256 for {} not set, do no verify download'.format(what.name))
elif what.sha256 != get_sha256(file_path):
os.remove(file_path)
raise StopBuild()
raise StopBuild("Sha 256 doesn't correspond")
class SkipCommand(Exception):
@ -135,7 +135,11 @@ class SkipCommand(Exception):
class StopBuild(Exception):
pass
def __init__(self, msg=""):
self.msg = msg
def __str__(self):
return self.msg
class Remotefile(namedtuple('Remotefile', ('name', 'sha256', 'url'))):