✨ feat: add CloseResponseBodyGracefully function to handle HTTP response body closure

This commit is contained in:
CaIon committed 2025-06-27 21:37:13 +08:00
1 parent 7ef4531a0f
commit ae586e1be9
23 files changed
+52 -125

No files matched your search

+1 -4
View File
@@ -90,10 +90,7 @@ func RelayErrorHandler(resp *http.Response, showBodyWhenFail bool) (errWithStatu
if err != nil {
return
}
err = resp.Body.Close()
if err != nil {
return
}
common.CloseResponseBodyGracefully(resp)
var errResponse dto.GeneralErrorResponse
err = json.Unmarshal(responseBody, &errResponse)
if err != nil {