diff --git a/kiwixbuild/builder.py b/kiwixbuild/builder.py index 4462fd4..b70c139 100644 --- a/kiwixbuild/builder.py +++ b/kiwixbuild/builder.py @@ -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") diff --git a/kiwixbuild/utils.py b/kiwixbuild/utils.py index 0f2844a..9cbd3f3 100644 --- a/kiwixbuild/utils.py +++ b/kiwixbuild/utils.py @@ -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'))):