Closed rjwignar closed 2 months ago
Can we remove the other fix you made before, or does it still have value?
I had both fixes in one branch and found that only this fix would be triggered if an error occured (there'd be a ChatCraft message but no Error Toast). We can remove the other fix.
Latest commit: |
48951a4
|
Status: | ✅ Deploy successful! |
Preview URL: | https://62f568e2.console-overthinker-dev.pages.dev |
Branch Preview URL: | https://issue-605-2.console-overthinker-dev.pages.dev |
This fixes #605
Background
If you use /import with a Youtube video that either has no English captions or no captions at all, ChatCraft will throw a non-descriptive error toast:![image](https://github.com/tarasglek/chatcraft.org/assets/78163326/5b5a7814-4faf-4adb-9233-5e460bb81d4b)
Caption extraction for YouTube videos is handled by youtube-captions-scraper within functions/lib/rewriters/youtube-rewriter.ts.
A previous PR for this (#618) would extract unhandled error messages from the HTML of a generated CloudFlare Pages page and put it inside an Error Toast.
Fix
In this PR, any errors thrown in youtube-rewriter will show up in the /import Response (as a ChatCraft message):![image](https://github.com/tarasglek/chatcraft.org/assets/78163326/99c5e045-cdce-4354-9a61-ef0e67f479aa)