Skip to content

Commit

Permalink
raise on None response message
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanMarten committed Dec 15, 2024
1 parent 3e5a919 commit 239badc
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ async def process_requests_from_file(
f"{response.response_errors}, removing from output and will retry"
)
num_previously_failed_requests += 1
if response.response_message is None:
logger.debug(
f"Request {response.generic_request.original_row_idx} previously failed due to no response, removing from output and will retry"
)
num_previously_failed_requests += 1
else:
completed_request_ids.add(response.generic_request.original_row_idx)
output_file.write(line)
Expand Down Expand Up @@ -476,6 +481,9 @@ async def handle_single_request_with_retries(
status_tracker.num_tasks_succeeded += 1
status_tracker.pbar.update(1)

if generic_response.response_message is None:
raise ValueError(f"Request {request.task_id} returned no response message")

except Exception as e:
logger.warning(
f"Request {request.task_id} failed with Exception {e}, attempts left {request.attempts_left}"
Expand Down

0 comments on commit 239badc

Please sign in to comment.