pmb.flasher.frontend: Use NonBugError for nonexistent rootfs code path (MR 2540)

We fully expect to reach this code path within normal use of
pmbootstrap. It's not a bug if we get here. As such, use NonBugError to
indicate that and clean up the output.
This commit is contained in:
Newbyte 2025-01-28 18:58:20 +01:00 committed by Oliver Smith
parent 3ef25e1467
commit 8c55680b03
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -4,6 +4,7 @@ from __future__ import annotations
from pmb.core.context import get_context from pmb.core.context import get_context
from pmb.helpers import logging from pmb.helpers import logging
from pmb.helpers.exceptions import NonBugError
import pmb.config import pmb.config
from pmb.parse.deviceinfo import Deviceinfo from pmb.parse.deviceinfo import Deviceinfo
@ -92,7 +93,7 @@ def rootfs(
img_path = Chroot.native() / "home/pmos/rootfs" / f"{deviceinfo.codename}{suffix}" img_path = Chroot.native() / "home/pmos/rootfs" / f"{deviceinfo.codename}{suffix}"
if not img_path.exists(): if not img_path.exists():
raise RuntimeError( raise NonBugError(
"The rootfs has not been generated yet, please run 'pmbootstrap install' first." "The rootfs has not been generated yet, please run 'pmbootstrap install' first."
) )