Skip to content

Commit

Permalink
fix: handle error when loading model resources
Browse files Browse the repository at this point in the history
  • Loading branch information
micovery committed Apr 14, 2024
1 parent 8f6f314 commit d9a7eb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/apigee/v1/apiproxymodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (a *APIProxyModel) HydrateModelFromYAMLDoc(filePath string) error {
return errors.New(err)
}

LoadAPIProxyModelResources(a, filepath.Dir(filePath))
err = LoadAPIProxyModelResources(a, filepath.Dir(filePath))
if err != nil {
return errors.New(err)
}
Expand Down Expand Up @@ -173,12 +173,12 @@ func LoadAPIProxyModelResources(proxyModel *APIProxyModel, fromDir string) error
}

for _, resource := range proxyModel.Resources.List {
url, err := url.Parse(resource.Path)
parsedUrl, err := url.Parse(resource.Path)
if err != nil {
return errors.New(err)
}

content, err := os.ReadFile(url.Path)
content, err := os.ReadFile(parsedUrl.Path)
if err != nil {
return errors.New(err)
}
Expand Down

0 comments on commit d9a7eb7

Please sign in to comment.