About 261,000 results
Open links in new tab
  1. 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: …

  2. 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 …

  3. 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 …

  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 - Exception handling : throw, throws and Throwable - Stack …

    Oct 15, 2010 · Can any of you explain what the differences are between throw, throws and Throwable and when to use which?

  6. Handling exceptions from Java ExecutorService tasks

    Handling exceptions from Java ExecutorService tasks Asked 15 years, 10 months ago Modified 5 months ago Viewed 251k times

  7. java - Throwing exception from CompletableFuture - Stack Overflow

    Jun 7, 2017 · This solution will re-throw all “unexpected” throwables in their wrapped form, but only throw the custom ServerException in its original form passed via the exception future.

  8. java - Spring Boot REST service exception handling - Stack Overflow

    Mar 6, 2015 · With Spring Boot 1.4+ new cool classes for easier exception handling were added that helps in removing the boilerplate code. A new @RestControllerAdvice is provided for …

  9. 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 …

  10. Order of catching exceptions in Java - Stack Overflow

    Jun 10, 2012 · So, when catching exceptions you want to always catch the most specific first and then the most generic (as RuntimeException or Exception). For instance, imagine you would …