Why spring processes only unchecked exceptions

I want to know why spring processes only unchecked exceptions ..... can anyone explain what the reason for this is.

Does Spring use any design patterns that avoid checked exceptions?

+4
source share
1 answer

Does Spring use any design patterns that exceptions will not be checked?

Not a design pattern, but exception handling guidelines .

Consider the code below:

public void consumeAndForgetAllExceptions(){
    try {
        ...some code that throws exceptions
    } catch (Exception ex){
        ex.printStacktrace();
    }
}

What is wrong with the code above?

, catch. catch . catch, .

?

public void someMethod() throws Exception{
}

; . ? Java .

, spring ?

, throw. , . , , , . , spring framework.

API

  • , .
  • , . , , .

API Java ,   NullPointerException, IllegalArgumentException IllegalStateException. , Java, . .

. :

+11

Source: https://habr.com/ru/post/1537256/


All Articles