You searched for exceptions
. We found 168
results in 0.240 seconds.
Async methods don't normally throw exceptions directly - they return tasks which end up being faulted. The simplest way to create such a task is to use Task.FromException. You haven't given many details in your question, but I suspect if... more
Your data doesn't contain a List<PersonObject> - it contains a single PersonObject which in turn contains a List<Person>. So this works fine: var json = File.ReadAllText("test.json"); var obj =... more
The exception isn't thrown within the method you've shown - you're basically returning a query to the caller, and that query is then failing. One option would be to force the query to execute immediately by calling ToList(). That way, any... more
First, stop building SQL like that - use parameterized SQL and a PreparedStatement. Your current code is vulnerable to SQL injection attacks. Basically, don't call rs.next() twice in a row (first in the if then in the while)... you can... more
I can't immediately tell you where the problem is, but I can tell you how to find out. First, remove this catch block (and indeed the try clause): catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } That is... more
I've come across exactly this problem in the last week. I strongly suspect that it is related to access tokens expiring or other errors: I've regularly seen this occur after my program has been active for 5 minutes (of polling every 20... more
I strongly suspect you're getting exceptions logged - you should improve your exception handling anyway, but if you're going to log exceptions, you really need to look in the logs when things don't work! This is almost certainly the... more
Usually, a RuntimeException indicates a programming error (in which case you can't "handle" it, because if you knew to expect it you'd have avoided the error). Catching any of these general exceptions (including Throwable) is a bad idea... more
No, there's nothing within the framework that does this as far as I'm aware. Your second option seems sensible to me. You'll need to make it read-only, throwing appropriate exceptions for the mutating operations of IList<T>. One... more
The premise of the question is flawed, because catching Exception does catch RuntimeException. Demo code: public class Test { public static void main(String[] args) { try { throw new RuntimeException("Bang"); ... more