Skip to content

Commit

Permalink
fix: adds proxy or sf name to the error #534
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Sep 12, 2024
1 parent b6b58f1 commit 8e5ab1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions internal/client/apis/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@ func importAPIProxies(wg *sync.WaitGroup, jobs <-chan string, errs chan<- error)

u, _ := url.Parse(apiclient.GetApigeeBaseURL())
q := u.Query()
q.Set("name", strings.TrimSuffix(filepath.Base(job), ".zip"))
n := strings.TrimSuffix(filepath.Base(job), ".zip")
q.Set("name", n)
q.Set("action", "import")
u.RawQuery = q.Encode()
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg(), "apis")
Expand Down Expand Up @@ -622,7 +623,7 @@ func importAPIProxies(wg *sync.WaitGroup, jobs <-chan string, errs chan<- error)
b = []byte(err.Error())
}
if err != nil || resp.StatusCode < 200 || resp.StatusCode >= 300 {
errs <- fmt.Errorf("bundle not imported: (HTTP %v) %s", resp.StatusCode, b)
errs <- fmt.Errorf("bundle %s not imported: (HTTP %v) %s", n, resp.StatusCode, b)
continue
}

Expand Down
5 changes: 3 additions & 2 deletions internal/client/sharedflows/sharedflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ func importSharedFlows(wg *sync.WaitGroup, jobs <-chan string, errs chan<- error

u, _ := url.Parse(apiclient.GetApigeeBaseURL())
q := u.Query()
q.Set("name", strings.TrimSuffix(filepath.Base(job), ".zip"))
n := strings.TrimSuffix(filepath.Base(job), ".zip")
q.Set("name", n)
q.Set("action", "import")
u.RawQuery = q.Encode()
u.Path = path.Join(u.Path, apiclient.GetApigeeOrg(), "sharedflows")
Expand Down Expand Up @@ -489,7 +490,7 @@ func importSharedFlows(wg *sync.WaitGroup, jobs <-chan string, errs chan<- error
b = []byte(err.Error())
}
if err != nil || resp.StatusCode < 200 || resp.StatusCode >= 300 {
errs <- fmt.Errorf("bundle not imported: (HTTP %v) %s", resp.StatusCode, b)
errs <- fmt.Errorf("bundle %s not imported: (HTTP %v) %s", n, resp.StatusCode, b)
continue
}

Expand Down

0 comments on commit 8e5ab1d

Please sign in to comment.