Print ERROR: infront of {NonBug,BuildFailed}Error (MR 2298)
Make the handling of the custom NonBugError and BuildFailedError exceptions more consistent with the handling of other exceptions, by printing "ERROR: " infront of the actual error text. Then we don't need to duplicate that where we raise the errors. pmbootstrap prints "ERROR" in red.
This commit is contained in:
parent
888026e95d
commit
db163aded6
|
@ -88,11 +88,11 @@ def main():
|
||||||
sys.exit(130) # SIGINT(2) + 128
|
sys.exit(130) # SIGINT(2) + 128
|
||||||
|
|
||||||
except NonBugError as exception:
|
except NonBugError as exception:
|
||||||
logging.error(exception)
|
logging.error(f"ERROR: {exception}")
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
except BuildFailedError as exception:
|
except BuildFailedError as exception:
|
||||||
logging.error(exception)
|
logging.error(f"ERROR: {exception}")
|
||||||
print_log_hint(args)
|
print_log_hint(args)
|
||||||
return 3
|
return 3
|
||||||
|
|
||||||
|
|
|
@ -535,6 +535,6 @@ def package(args, pkgname, arch=None, force=False, strict=False,
|
||||||
(output, cmd, env) = run_abuild(args, apkbuild, arch, strict, force, cross,
|
(output, cmd, env) = run_abuild(args, apkbuild, arch, strict, force, cross,
|
||||||
suffix, src, bootstrap_stage)
|
suffix, src, bootstrap_stage)
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
raise BuildFailedError(f"ERROR: Build for {arch}/{pkgname} failed!")
|
raise BuildFailedError(f"Build for {arch}/{pkgname} failed!")
|
||||||
finish(args, apkbuild, arch, output, strict, suffix)
|
finish(args, apkbuild, arch, output, strict, suffix)
|
||||||
return output
|
return output
|
||||||
|
|
|
@ -272,7 +272,7 @@ def check(args, pkgname, components_list=[], details=False, must_exist=True):
|
||||||
config_name_split = config_name.split(".")
|
config_name_split = config_name.split(".")
|
||||||
|
|
||||||
if len(config_name_split) != 2:
|
if len(config_name_split) != 2:
|
||||||
raise NonBugError(f"ERROR: {config_name} is not a valid kernel config "
|
raise NonBugError(f"{config_name} is not a valid kernel config"
|
||||||
"name. Ensure that the _config property in your "
|
"name. Ensure that the _config property in your "
|
||||||
"kernel APKBUILD has a . before the "
|
"kernel APKBUILD has a . before the "
|
||||||
"architecture name, e.g. .aarch64 or .armv7, "
|
"architecture name, e.g. .aarch64 or .armv7, "
|
||||||
|
|
Loading…
Reference in New Issue