pmb.parse.kconfig: Raise NonBugError on invalid kernel config (MR 2279)

The intent of 9a74848f19 was to not print
a stacktrace when this happened. However, I still opted to raise an
exception, so you still get a stacktrace, just with a more helpful
message. There's no need to give the user a big stacktrace here, so
raise a NonBugError instead of a RuntimeError.
This commit is contained in:
Newbyte 2024-03-14 22:50:26 +01:00
parent 9723191fe5
commit ced93fee7b
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 9 additions and 7 deletions

View file

@ -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)