You searched for exceptions
. We found 168
results in 0.125 seconds.
It turns out that await can throw AggregateException, though, which is not documented behavior. No, that's the behaviour when the first nested exception is an AggregateException. Basically, when you call... more
Will there be any negative performance implications on the following code due to methods that do not throw exceptions being inside of a try block? No, it won't have any performance implications, but: I would generally put minimal... more
Why not throw just a single InvalidConfigurationException (I wouldn't use ParsingError - aside from anything else, I wouldn't expect this to be an Error subclass) which contains information about the specific problems? That information... more
You can do so - and it'll show up in the Javadoc, I believe. But it won't force any callers to handle the exception, so you're still basically relying on the users (developers calling your code) to be diligent enough to check the... more
A suppressed exception is one which would have happened if another exception hadn't occurred. I'm only aware of one case where this happens, which is with a try-with-resources statement. The JLS (14.20.3) says: Resources are closed in... more
Sounds like you probably want ArgumentException, or ArgumentNullException, or ArgumentOutOfRangeException depending on the precise nature. (The latter exceptions are subtypes of the first.) more
I thought async methods run synchronously until reaching a blocking method. They do, but they're still aware that they're executing within an asynchronous method. If you throw an exception directly from an async void method, the... more
However, because of the strong relational aspect of try-catch, I am wondering if the variable declared in try is in scope for catch? You can test this easily for yourself, but the answer is no. (Second part) Would that... more
Ideally, I would suggest using TextReader as your abstraction level - it's rarely necessary to depend on StreamReader directly, as messing around with the underlying stream is generally a bad idea anyway. If you have code that takes a... more
I suspect it turns out to be safe because GroupBy doesn't stream results - it consumes all of the input before it returns any values. (It's lazy in that it doesn't do any work until you ask it for its first element, but then it consumes... more