From 9ae52f75c6c4af402c83a67ef0ef2c7153d7d99a Mon Sep 17 00:00:00 2001 From: Hugues Malphettes Date: Sat, 28 Sep 2019 15:34:58 +0800 Subject: [PATCH] Improve error message when forking a repository --- default_api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default_api.go b/default_api.go index 7e9fe35..2bf08ff 100644 --- a/default_api.go +++ b/default_api.go @@ -3056,8 +3056,8 @@ func (a *DefaultApiService) ForkRepository(projectKey, repositorySlug string, } defer localVarHTTPResponse.Body.Close() if localVarHTTPResponse.StatusCode >= 300 { - bodyBytes, _ := io.ReadAll(localVarHTTPResponse.Body) - return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes)) + bodyBytes, _ := ioutil.ReadAll(localVarHTTPResponse.Body) + return NewAPIResponseWithError(localVarHTTPResponse, reportError("Status: %s, Url: %s, Body: %s", localVarHTTPResponse.Status, localVarPath, bodyBytes)) } return NewBitbucketAPIResponse(localVarHTTPResponse)