From 59424e0a9016ab575a8056686e2f4318c7e2a89b Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 12 Oct 2023 14:28:23 +0300 Subject: [PATCH] Fix missing error handling --- do/serverless.go | 3 +++ internal/apps/builder/cnb.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/do/serverless.go b/do/serverless.go index 493674fd0..52ca94a20 100644 --- a/do/serverless.go +++ b/do/serverless.go @@ -777,6 +777,9 @@ func (s *serverlessService) GetHostInfo(APIHost string) (ServerlessHostInfo, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) + if err != nil { + return ServerlessHostInfo{}, err + } var result ServerlessHostInfo err = json.Unmarshal(body, &result) return result, err diff --git a/internal/apps/builder/cnb.go b/internal/apps/builder/cnb.go index e9bbfcc64..2f334c514 100644 --- a/internal/apps/builder/cnb.go +++ b/internal/apps/builder/cnb.go @@ -231,6 +231,9 @@ func (b *CNBComponentBuilder) buildStaticSiteImage(ctx context.Context) error { return err } assetsPath, err = filepath.Rel(workspacePath, assetsPath) + if err != nil { + return err + } if assetsPath == "." { assetsPath = "./" } else {