Exception escapes try/catch
See original GitHub issueHey, when I try to download a restricted video in my country just like this: “https://www.youtube.com/watch?v=iN8PKcNGcuI” I get an exception saying “YoutubeExplode.Exceptions.VideoUnavailableException” and the program stops working. even that I wrote it in (try-catch) how to fix it? Here is a part of my code(it stops at the last line)
try
{
//string Path = Directory.GetCurrentDirectory();
//GrantAccess(Path);
var url = GetYoutubeUrl();
if (url != "")
{
var id = YoutubeClient.ParseVideoId(url); // "bnsUkE8i0tU"
var client = new YoutubeClient();
var streamInfoSet = await client.GetVideoMediaStreamInfosAsync(id);
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Is it possible for an exception to escape a try catch block?
catch (Exception ex) and just catch have become same. and no, it's not possible to escape from try/catch except StackoverFlowException etc.
Read more >try...catch - JavaScript - MDN Web Docs - Mozilla
When an exception is thrown in the try block, exceptionVar (i.e., the e in catch (e) ) holds the exception value. You can...
Read more >Escaping the Exception Trap (Java in General forum at ...
I have a situation in a java program where exclude a statement from the exception trap. Below is the example that will make...
Read more >Exception propagation: When should I catch exceptions?
If a method can't handle the exception, and doesn't need to do anything else when an exception is thrown then there is no...
Read more >Exceptions and debugging - Advanced R. - Hadley Wickham
tryCatch () is a general tool for handling conditions: in addition to errors, you can take different actions for warnings, messages, and interrupts....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
how does your catch look like? I can’t reproduce this at all. This is possible unless you rethrow exception in catch, or you have try/finally without catch.
I can reproduce this with:
and
but with:
I get output catch and there are no unhandled exceptions thrown.
I’ve also had a few of these which kinda sucks… Can’t find a way around it. As far as I know, you can’t download videos that are blocked 😕 A VPN could possibly work but I haven’t been bothered enough to try