From 95f52ab89ef5f1acffec9e9313740634fa5d9c4b Mon Sep 17 00:00:00 2001 From: HamadaSalhab Date: Tue, 8 Oct 2024 17:10:57 +0300 Subject: [PATCH] Add Box & Beartype exceptions to the list of non-retryable errors --- .../agents_api/common/exceptions/tasks.py | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/agents-api/agents_api/common/exceptions/tasks.py b/agents-api/agents_api/common/exceptions/tasks.py index d9e64382b..3e6a2087e 100644 --- a/agents-api/agents_api/common/exceptions/tasks.py +++ b/agents-api/agents_api/common/exceptions/tasks.py @@ -4,8 +4,10 @@ Temporal interceptors to prevent unnecessary retries of certain error types. """ -import asyncio - +import beartype +import beartype.roar +import box +import box.exceptions import fastapi import httpx import jinja2 @@ -66,6 +68,24 @@ pydantic.ValidationError, requests.exceptions.InvalidURL, requests.exceptions.MissingSchema, + # Box exceptions + box.exceptions.BoxKeyError, + box.exceptions.BoxTypeError, + box.exceptions.BoxValueError, + # Beartype exceptions + beartype.roar.BeartypeException, + beartype.roar.BeartypeDecorException, + beartype.roar.BeartypeDecorHintException, + beartype.roar.BeartypeDecorHintNonpepException, + beartype.roar.BeartypeDecorHintPepException, + beartype.roar.BeartypeDecorHintPepUnsupportedException, + beartype.roar.BeartypeDecorHintTypeException, + beartype.roar.BeartypeDecorParamException, + beartype.roar.BeartypeDecorParamNameException, + beartype.roar.BeartypeCallHintParamViolation, + beartype.roar.BeartypeCallHintReturnViolation, + beartype.roar.BeartypeDecorHintParamDefaultViolation, + beartype.roar.BeartypeDoorHintViolation, ]