diff --git a/pmb/parse/kconfig.py b/pmb/parse/kconfig.py index 9562dd71..872098b9 100644 --- a/pmb/parse/kconfig.py +++ b/pmb/parse/kconfig.py @@ -9,6 +9,7 @@ import pmb.build import pmb.config import pmb.parse import pmb.helpers.pmaports +from pmb.helpers.exceptions import NonBugError def get_all_component_names(): @@ -271,12 +272,12 @@ def check(args, pkgname, components_list=[], details=False, must_exist=True): config_name_split = config_name.split(".") if len(config_name_split) != 2: - raise RuntimeError(f"{config_name} is not a valid kernel config " - "name. Ensure that the _config property in your " - "kernel APKBUILD has a . before the " - "architecture name, e.g. .aarch64 or .armv7, " - "and that there is no excess punctuation " - "elsewhere in the name.") + raise NonBugError(f"ERROR: {config_name} is not a valid kernel config " + "name. Ensure that the _config property in your " + "kernel APKBUILD has a . before the " + "architecture name, e.g. .aarch64 or .armv7, " + "and that there is no excess punctuation " + "elsewhere in the name.") config_arch = config_name_split[1] ret &= check_config(config_path, config_arch, pkgver, components_list, diff --git a/test/test_parse_kconfig.py b/test/test_parse_kconfig.py index 8c6d311c..2c148190 100644 --- a/test/test_parse_kconfig.py +++ b/test/test_parse_kconfig.py @@ -7,6 +7,7 @@ import os import pmb_test # noqa import pmb.parse.kconfig +from pmb.helpers.exceptions import NonBugError test_options_checked_count = None @@ -345,7 +346,7 @@ def test_check(args, monkeypatch, tmpdir): handle.write('CONFIG_BOOL=m\n') must_exist = True pkgname = "linux-nokia-n900" - with pytest.raises(RuntimeError) as e: + with pytest.raises(NonBugError) as e: func(args, pkgname, components_list, details, must_exist) assert "is not a valid kernel config" in str(e.value) os.unlink(path_kconfig)