This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch release-v1.0
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v1.0 by this push:
     new 8e49b6384 fix: bitbucket remote api swallows errors sliently (#7583) 
(#7590)
8e49b6384 is described below

commit 8e49b6384ee7131cfd9c90c65e0287cfc0bf5670
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jun 7 16:36:58 2024 +0800

    fix: bitbucket remote api swallows errors sliently (#7583) (#7590)
    
    Co-authored-by: Klesh Wong <[email protected]>
---
 backend/plugins/bitbucket/api/remote_api.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backend/plugins/bitbucket/api/remote_api.go 
b/backend/plugins/bitbucket/api/remote_api.go
index d81c0d027..2da3f7ab6 100644
--- a/backend/plugins/bitbucket/api/remote_api.go
+++ b/backend/plugins/bitbucket/api/remote_api.go
@@ -19,6 +19,7 @@ package api
 
 import (
        "fmt"
+       "io"
        "net/http"
        "net/url"
 
@@ -116,6 +117,13 @@ func listBitbucketRepos(
        if err != nil {
                return
        }
+       if res.StatusCode > 299 {
+               body, e := io.ReadAll(res.Body)
+               if e != nil {
+                       return nil, nil, errors.BadInput.Wrap(e, "failed to 
read response body")
+               }
+               return nil, nil, errors.BadInput.New(string(body))
+       }
        var resBody models.ReposResponse
        err = api.UnmarshalResponse(res, &resBody)
        if err != nil {

Reply via email to