Skip to content

Commit

Permalink
"Refactor error handling in YouTube utility files to provide more des…
Browse files Browse the repository at this point in the history
…criptive error messages."
  • Loading branch information
buhe committed Jul 15, 2023
1 parent 93ed9dc commit 85e949e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/LangChain/utilities/youtube/Transcript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct Transcript {
return _TranscriptParser().parse(plain_data: plain)
} else {
// handle remote error
print("http code is not 200.")
print("get transcript http code is not 200.")
return nil
}
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct TranscriptListFetcher {
return String(buffer: try await response.body.collect(upTo: 1024 * 1024))
} else {
// handle remote error
print("http code is not 200.")
print("get list http code is not 200.\(response.body)")
return "Bad requset."
}
} catch {
Expand Down
2 changes: 1 addition & 1 deletion Sources/LangChain/utilities/youtube/YoutubeInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct YoutubeInfoFetcher {
return YoutubeInfoParse().parse(plain_data: plain)
} else {
// handle remote error
print("http code is not 200.")
print("get video info http code is not 200.")
return nil
}
} catch {
Expand Down

0 comments on commit 85e949e

Please sign in to comment.