You searched for exceptions
. We found 168
results in 0.031 seconds.
Assuming you're using Java 7, you should be able to use this syntax: catch (StaleElementReferenceException | NoSuchElementException e) Note the single |, as well as the single variable name. See the "Catching Multiple Exception Types... more
Both of those exceptions would be thrown back to the caller... although a single exception in any particular situation. If the body of the outer try block throws and then close throws as well, only the second exception would be seen by the... more
My guess is that you're actually running on .NET 4.5. Bear in mind that .NET 4.5 is effectively installed over the top of .NET 4. Even if your application is targeted at .NET 4, if the user has installed .NET 4.5 you'll get the new... more
You're calling Task.Wait() - which will throw an exception if the task is faulted. If you don't call Task.Wait(), you won't get the exception in your thread... but of course you won't spot when it's finished, either. There are various ways... more
It sounds like you probably want something like this: private T CallWithRetries<T>(Func<T> call) { // TODO: Work out number of retries, etc. for (int i = 0; i < 3; i++) { try { return... more
Two options: You could just ignore Encoding entirely, and write the loop yourself: public static bool TryParse(string s, out byte[] result) { result = null; // TODO: It's not clear why you don't want to be able to convert an... more
The Task<bool> returned from your Test method will become faulted. If you await that task (or call Wait() on it) then the exception will be rethrown at that point. If you choose to ignore the faulted state of the task, then yes,... more
No - the result of calling the method is a RuntimeException, and that's what you're testing. How is JUnit meant to tell the difference between a RuntimeException from the exact method you're calling, and one from a dependent call? One of... more
In this case, is it still used as a bitwise operator or does it have a different meaning when in context? It has a different meaning - although it's of the same "flavour" in that it's "if exception X is caught, or exception Y is... more
The exception being declared isn't about what that implementation can throw - it's about what that implementation or the implementation in subclasses can throw. Service is an abstract class - and so are the two direct subclasses... more