You searched for exceptions
. We found 168
results in 0.152 seconds.
What happened to Mario ?? You changed it, basically. Yes, with reflection you can violate the immutability of strings... and due to string interning, that means any use of "Mario" (other than in a larger string constant expression,... more
It sounds like you just need to return a Task<bool> then: private async Task<bool> RefreshContactsAsync() { try { ... } catch // TODO: Catch more specific exceptions { return false; } ... more
When I run that code, I see an exception: Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'c:\Test.txt' is denied. It's not clear how you're running this, but if it's configured as a console app and you run... more
If you don't have anything you need to clean up at the end, that's perfectly fine. finally blocks are almost always about resource cleanup... and there are plenty of times where you want to catch an exception but don't have any resources... more
I haven't used the library myself, but it seems reasonably clear why your usage would fail: your code for the first statement is equivalent to: Operation op = new Operation("" , "."); verifyException(op,... more
Just avoid examining the connection object after you've disposed of it. ("Doctor, it hurts when I do this..." "Stop doing that then!") The easiest - and most reliable - way to do that is to use a using statement instead: using (var conn =... more
Closeable is restricted to throw IOException, which may not be appropriate for some closeable but non-IO-bound resources. AutoCloseable is declared to throw Exception, making it more general-purpose. The API for Closeable can't be... more
Yes, you're calling the method via reflection. So as per the documentation, a TargetInvocationException will be thrown if the target method throws an exception. Just use the InnerException property to obtain - and potentially throw - the... more
Well, you won't be able to use async in the initial call. That much is clear. But you can use a synchronous delegate which calls the function, and then captures the returned task to await it inside an async delegate: public static... more
You never assign a value to iKey, so it has its initial default value of null - it's as simple as that. You need to create a new array, e.g. // Given that you've hard-coded the length of cKey as well... iKey = new int[2][2]; I'd also... more