Skip to content

Commit 567713a

Browse files
committed
Use correct formatter based on data type
Signed-off-by: Md Soharab Ansari <[email protected]>
1 parent 8e90b68 commit 567713a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: common/util.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,25 @@ func HandleHTTPRequest(message string, headers http.Header, data ConnectorMetada
122122
}
123123

124124
if resp == nil {
125-
errResp.Response.ErrorString = fmt.Sprintf("every function invocation retry failed; final retry gave empty response. http_endpoint: %v, source: %v", data.HTTPEndpoint, data.SourceName)
125+
errResp.Response.ErrorString = fmt.Sprintf("every function invocation retry failed; final retry gave empty response. http_endpoint: %s, source: %s", data.HTTPEndpoint, data.SourceName)
126126
errorBytes, err := json.Marshal(errResp)
127127
if err != nil {
128-
return nil, fmt.Errorf("failed marshalling error response. http_endpoint: %v, source: %v", data.HTTPEndpoint, data.SourceName)
128+
return nil, fmt.Errorf("failed marshalling error response. http_endpoint: %s, source: %s", data.HTTPEndpoint, data.SourceName)
129129
}
130130
return nil, errors.New(string(errorBytes))
131131
}
132132

133133
if resp.StatusCode < 200 || resp.StatusCode > 300 {
134134
body, err := io.ReadAll(resp.Body)
135135
if err != nil {
136-
return nil, fmt.Errorf("failed reading response body. http_endpoint: %v, source: %v", data.HTTPEndpoint, data.SourceName)
136+
return nil, fmt.Errorf("failed reading response body. http_endpoint: %s, source: %s", data.HTTPEndpoint, data.SourceName)
137137
}
138138
errResp.Response.ResponseBody = string(body)
139139
errResp.Response.StatusCode = resp.StatusCode
140-
errResp.Response.ErrorString = fmt.Sprintf("request returned failure: %v. http_endpoint: %v, source: %v", resp.StatusCode, data.HTTPEndpoint, data.SourceName)
140+
errResp.Response.ErrorString = fmt.Sprintf("request returned failure: %d. http_endpoint: %s, source: %s", resp.StatusCode, data.HTTPEndpoint, data.SourceName)
141141
errorBytes, err := json.Marshal(errResp)
142142
if err != nil {
143-
return nil, fmt.Errorf("failed marshalling error response. http_endpoint: %v, source: %v", data.HTTPEndpoint, data.SourceName)
143+
return nil, fmt.Errorf("failed marshalling error response. http_endpoint: %s, source: %s", data.HTTPEndpoint, data.SourceName)
144144
}
145145
return nil, errors.New(string(errorBytes))
146146
}

0 commit comments

Comments
 (0)