Yes, correct, by the time the exception is thrown, the program would've passed the point of catching it.
If you absolutely need to run synchronously and for some reason don't want to use "await", you could use ".GetAwaiter().GetResult();" to be able to catch the exception gracefully, otherwise, the exception would not be thrown.
Here is a snippet if you want to try it out dotnetfiddle.net/uXBsWT
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Apart from //"not awaiting inner methods"// What'll happen if we are not awaiting a method ?
Calling an async method without await (and without awaiting it's returned task) will not have any impact in asynchronous nature of code . Will it ?
One disadvantage is exception can't be handled if we are not awaiting. Can anyone share what else if we aren't awaiting?
Yes, correct, by the time the exception is thrown, the program would've passed the point of catching it.
If you absolutely need to run synchronously and for some reason don't want to use "await", you could use ".GetAwaiter().GetResult();" to be able to catch the exception gracefully, otherwise, the exception would not be thrown.
Here is a snippet if you want to try it out dotnetfiddle.net/uXBsWT