diff --git a/internal/service/task.go b/internal/service/task.go index 9f3eb2b..d55f0c3 100644 --- a/internal/service/task.go +++ b/internal/service/task.go @@ -9,6 +9,7 @@ import ( "io" "net/http" "strings" + "time" "gitea.com/texpixel/document_ai/internal/model/task" "gitea.com/texpixel/document_ai/internal/storage/dao" @@ -187,8 +188,13 @@ func (svc *TaskService) ExportTask(ctx context.Context, req *task.ExportTaskRequ defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - body, _ := io.ReadAll(resp.Body) - log.Error(ctx, "func", "ExportTask", "msg", "http request failed", "status", resp.StatusCode, "body", string(body)) + respBody, _ := io.ReadAll(resp.Body) + log.Error(ctx, "func", "ExportTask", "msg", "export service returned non-200", + "status", resp.StatusCode, + "body", string(respBody), + "markdown_len", len(markdown), + "filename", filename, + ) return nil, "", fmt.Errorf("export service returned status: %d", resp.StatusCode) }