Skip to content

Commit

Permalink
ux: catch fatal whisper API error
Browse files Browse the repository at this point in the history
  • Loading branch information
bakaburg1 committed Mar 8, 2024
1 parent 4a2d159 commit b66b912
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/speech_to_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ use_azure_whisper_stt <- function(
# Make the HTTP request
response <- httr::POST(url, headers, body = body)

if (response$status_code == 424) {
stop("Fatal error: ", httr::content(response, "text"))
}

# Check response status
if (response$status_code != 200) {

Expand Down

0 comments on commit b66b912

Please # to comment.