From d5d2bff55e119a4fe4d4b8d7c9c8176fbf25f594 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 28 Dec 2021 15:54:33 +0100 Subject: [PATCH] Do not abort build if loading errors happens for not compiled platforms This is mostly useful for "arduino-builder". --- legacy/builder/hardware_loader.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/legacy/builder/hardware_loader.go b/legacy/builder/hardware_loader.go index 1d0dc72b695..a73f4ecad86 100644 --- a/legacy/builder/hardware_loader.go +++ b/legacy/builder/hardware_loader.go @@ -18,7 +18,6 @@ package builder import ( "github.com/arduino/arduino-cli/arduino/cores/packagemanager" "github.com/arduino/arduino-cli/legacy/builder/types" - "github.com/pkg/errors" ) type HardwareLoader struct{} @@ -33,7 +32,13 @@ func (s *HardwareLoader) Run(ctx *types.Context) error { // I have no intention right now to start a refactoring of the legacy package too, so // here's this shitty solution for now. // When we're gonna refactor the legacy package this will be gone. - return errors.WithStack(errs[0].Err()) + + if ctx.Verbose { + log := ctx.GetLogger() + for _, err := range errs { + log.Println("info", "Error loading hardware platform: {0}", err.Message()) + } + } } ctx.PackageManager = pm }