taspol commited on
Commit
a6e766c
·
1 Parent(s): af1098a

feat: add cold debugging

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -67,9 +67,9 @@ def generate_trip_plan(request: PlanRequest):
67
  "attempt": attempt + 1
68
  }
69
  )
70
- except (asyncio.TimeoutError, ConnectionError) as timeout_error:
71
- logger.warning(f"Timeout error on attempt {attempt + 1}: {timeout_error}")
72
-
73
  # If this was the last attempt, raise the error
74
  if attempt == MAX_RETRIES - 1:
75
  logger.error(f"All {MAX_RETRIES} attempts failed due to timeout")
@@ -86,18 +86,18 @@ def generate_trip_plan(request: PlanRequest):
86
  logger.info(f"Retrying in {RETRY_DELAY} seconds...")
87
  time.sleep(RETRY_DELAY)
88
 
89
- except Exception as e:
90
- # For non-timeout errors, don't retry
91
- logger.error(f"Non-timeout error in generate_trip_plan: {e}")
92
- raise HTTPException(
93
- status_code=500,
94
- detail={
95
- "error": "Internal server error",
96
- "message": "Failed to generate trip plan",
97
- "details": str(e),
98
- "attempt": attempt + 1
99
- }
100
- )
101
 
102
 
103
  @app.post("/v1/addYoutubeLink", response_model=YoutubeLinkResponse)
 
67
  "attempt": attempt + 1
68
  }
69
  )
70
+ except Exception as e:
71
+ logger.warning(f"Error on attempt {attempt + 1}: {e}")
72
+
73
  # If this was the last attempt, raise the error
74
  if attempt == MAX_RETRIES - 1:
75
  logger.error(f"All {MAX_RETRIES} attempts failed due to timeout")
 
86
  logger.info(f"Retrying in {RETRY_DELAY} seconds...")
87
  time.sleep(RETRY_DELAY)
88
 
89
+ # except Exception as e:
90
+ # # For non-timeout errors, don't retry
91
+ # logger.error(f"Non-timeout error in generate_trip_plan: {e}")
92
+ # raise HTTPException(
93
+ # status_code=500,
94
+ # detail={
95
+ # "error": "Internal server error",
96
+ # "message": "Failed to generate trip plan",
97
+ # "details": str(e),
98
+ # "attempt": attempt + 1
99
+ # }
100
+ # )
101
 
102
 
103
  @app.post("/v1/addYoutubeLink", response_model=YoutubeLinkResponse)