fix: PDF errors not loading in CI (#13236)

This commit is contained in:
Shivam Mishra
2026-01-12 15:22:15 +05:30
committed by GitHub
parent d526cf283d
commit b099d3a1eb
6 changed files with 23 additions and 31 deletions

View File

@@ -19,7 +19,7 @@ class Captain::Llm::PaginatedFaqGeneratorService < Llm::LegacyBaseOpenAiService
end
def generate
raise CustomExceptions::PdfFaqGenerationError, I18n.t('captain.documents.missing_openai_file_id') if @document&.openai_file_id.blank?
raise CustomExceptions::Pdf::FaqGenerationError, I18n.t('captain.documents.missing_openai_file_id') if @document&.openai_file_id.blank?
generate_paginated_faqs
end

View File

@@ -10,7 +10,7 @@ class Captain::Llm::PdfProcessingService < Llm::LegacyBaseOpenAiService
return if document.openai_file_id.present?
file_id = upload_pdf_to_openai
raise CustomExceptions::PdfUploadError, I18n.t('captain.documents.pdf_upload_failed') if file_id.blank?
raise CustomExceptions::Pdf::UploadError, I18n.t('captain.documents.pdf_upload_failed') if file_id.blank?
document.store_openai_file_id(file_id)
end