Skip to content

Commit

Permalink
fix: openai API error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanePark committed Mar 3, 2025
1 parent be435eb commit ef4266b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ class ScheduleTimeParsingWorker(
),
content = schedule.content
)
val response = scheduleTimeParsingService.parseScheduleTime(request)

val response: ScheduleTimeParsingResponse
try {
response = scheduleTimeParsingService.parseScheduleTime(request)
} catch (e: Exception) {
log.error("OpenAI API error", e)
return
}

if (responseFail(response, schedule)) return
if (haveNoTimeInfo(response, schedule)) return
Expand Down

0 comments on commit ef4266b

Please sign in to comment.