Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
mmabrouk committed May 5, 2024
1 parent f5cba9c commit bfbb467
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions agenta-backend/agenta_backend/services/llm_apps_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from agenta_backend.models.db_models import InvokationResult, Result, Error
from agenta_backend.utils import common

# Set logger
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -98,17 +99,16 @@ async def invoke_app(

except aiohttp.ClientResponseError as e:
error_message = f"HTTP error {e.status}: {e.message}"
logger.error(
f"HTTP error occurred during request: {error_message}")
common.capture_exception_in_sentry(e)
except aiohttp.ClientConnectionError as e:
error_message = f"Connection error: {str(e)}"
logger.error(error_message)
logger.error(f"HTTP error occurred during request: {error_message}")
common.capture_exception_in_sentry(e)
except aiohttp.ServerTimeoutError as e:
error_message = "Request timed out"
logger.error(error_message)
common.capture_exception_in_sentry(e)
except aiohttp.ClientConnectionError as e:
error_message = f"Connection error: {str(e)}"
logger.error(error_message)
common.capture_exception_in_sentry(e)
except json.JSONDecodeError as e:
error_message = "Failed to decode JSON from response"
logger.error(error_message)
Expand Down Expand Up @@ -162,8 +162,7 @@ async def run_with_retry(
return result
except aiohttp.ClientError as e:
last_exception = e
print(
f"Error in evaluation. Retrying in {retry_delay} seconds:", e)
print(f"Error in evaluation. Retrying in {retry_delay} seconds:", e)
await asyncio.sleep(retry_delay)
retries += 1
except Exception as e:
Expand Down

0 comments on commit bfbb467

Please sign in to comment.