feat: add log for export error
This commit is contained in:
@@ -187,7 +187,8 @@ func (svc *TaskService) ExportTask(ctx context.Context, req *task.ExportTaskRequ
|
|||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
log.Error(ctx, "func", "ExportTask", "msg", "http request failed", "status", resp.StatusCode)
|
body, _ := io.ReadAll(resp.Body)
|
||||||
|
log.Error(ctx, "func", "ExportTask", "msg", "http request failed", "status", resp.StatusCode, "body", string(body))
|
||||||
return nil, "", fmt.Errorf("export service returned status: %d", resp.StatusCode)
|
return nil, "", fmt.Errorf("export service returned status: %d", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user