mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-29 20:19:24 +08:00
Fix: expose the real error when ingest error (#17485)
This commit is contained in:
@@ -39,9 +39,16 @@ func (s *DocumentService) StartParseDocuments(ctx context.Context, doc *entity.D
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := s.IngestDocuments(ctx, doc.KbID, userID, []string{doc.ID}); err != nil {
|
||||
responses, err := s.IngestDocuments(ctx, doc.KbID, userID, []string{doc.ID})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(responses) == 0 {
|
||||
return fmt.Errorf("failed to enqueue document %s: empty ingestion response", doc.ID)
|
||||
}
|
||||
if !strings.HasPrefix(responses[0].Result, "task_id:") {
|
||||
return fmt.Errorf("failed to enqueue document %s: %s", doc.ID, responses[0].Result)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user