About 183,000 results
Open links in new tab
  1. Java 8 Lambda function that throws exception? - Stack Overflow

    Disclaimer: I haven't used Java 8 yet, only read about it. Function<String, Integer> doesn't throw IOException, so you can't put any code in it that throws IOException. If you're calling a method …

  2. java - Why use finally - Stack Overflow

    The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected exception occurs. But finally is useful for more than just …

  3. java - Using annotations for exception handling? - Stack Overflow

    The exception-throwing code lies in a third-party library that access an external service. I have a few classes that do a good deal of work with external services and there is a LOT of exception …

  4. Can I catch multiple Java exceptions in the same catch clause?

    In your Java 6 example shouldn't you be rethrowing the original exception instead of creating a new exception instance, i.e. throw exc instead of throw new RuntimeException(exc)?

  5. java - Spring WebClient - How to handle error scenarios - Stack …

    Will the above exception handling catch all other scenarios and will any of them have a response that needs to be consumed? Note: ClientResponse.releaseBody() was only introduced in 5.2

  6. What Java exception class to use for HTTP errors?

    11 Check out the page on Exception Handling for HttpClient To answer your question though there appears to be an org.apache.commons.httpclient.HttpException class that is probably a …

  7. java - Exception handling through spring AOP - Stack Overflow

    1 Consider using global exception handler by @ExceptionHandler and @ControllerAdvice Create a CustomExceptionHandler. Add @ControllerAdvice annotation at class level. And add …

  8. Java 8: How do I work with exception throwing methods in streams?

    With the sneak exception handler, the compiler now doesn't allow you to wrap the forEach in a try block, and if you mark the method as throws <checked exception>, will warn that that …

  9. How to create a custom exception type in Java? [duplicate]

    There is 1) creating a custom exception type/class (as shown so many times) and 2) raising the exception. To raise an exception, simply pass the appropriate instance to throw, normally: …

  10. What are the effects of exceptions on performance in Java?

    My testing (using Java 1.6.0_07, Java HotSpot 10.0, on 32 bit Linux), indicates that exception handling is no slower than regular code. I tried running a method in a loop that executes some …