Skip to content

Commit 482a658

Browse files
author
Bob Strahan
committed
raise exceptions to enable retry on throttling failures
1 parent 2212d2e commit 482a658

File tree

1 file changed

+2
-1
lines changed
  • lib/idp_common_pkg/idp_common/classification

1 file changed

+2
-1
lines changed

lib/idp_common_pkg/idp_common/classification/service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,12 @@ def classify_document(self, document: Document) -> Document:
940940
logger.error(error_msg)
941941
with errors_lock:
942942
document.errors.append(error_msg)
943-
944943
# Mark page as unclassified on error
945944
if page_id in document.pages:
946945
document.pages[page_id].classification = "unclassified"
947946
document.pages[page_id].confidence = 0.0
947+
# raise exception to enable client retries
948+
raise
948949

949950
# Group pages into sections only if we have results
950951
document.sections = []

0 commit comments

Comments
 (0)