From ea5d4e08140845dad46765c7abfe682f308c4b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikul=C3=A1=C5=A1=20=C5=A0=C5=A5astn=C3=BD?= Date: Wed, 8 Jan 2025 11:21:34 +0100 Subject: [PATCH] Improve error handling --- bap-builder/SysrootMode.go | 3 +++ modules/bringauto_context/ContextManager.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bap-builder/SysrootMode.go b/bap-builder/SysrootMode.go index dd1b527..ffafb96 100644 --- a/bap-builder/SysrootMode.go +++ b/bap-builder/SysrootMode.go @@ -51,6 +51,9 @@ func CreateSysroot(cmdLine *CreateSysrootCmdLineArgs, contextPath string) error return err } packages, err := contextManager.GetAllPackagesStructs(platformString) + if err != nil { + return err + } logger.Info("Creating sysroot directory from packages") err = unzipAllPackagesToDir(packages, &repo, *cmdLine.Sysroot) diff --git a/modules/bringauto_context/ContextManager.go b/modules/bringauto_context/ContextManager.go index 27604ba..de3a3fa 100644 --- a/modules/bringauto_context/ContextManager.go +++ b/modules/bringauto_context/ContextManager.go @@ -72,7 +72,7 @@ func (context *ContextManager) GetAllPackagesConfigs(platformString *bringauto_p func (context *ContextManager) GetAllPackagesStructs(platformString *bringauto_package.PlatformString) ([]bringauto_package.Package, error) { packConfigs, err := context.GetAllPackagesConfigs(platformString) if err != nil { - return []bringauto_package.Package{}, nil + return []bringauto_package.Package{}, err } var packages []bringauto_package.Package