public static final Level brokenConnection ( Level level , Throwable thr ) { if ( thr instanceof EOFException ) { return level ; } if ( thr instanceof ClosedChannelException ) { return level ; } if ( ( thr instanceof IOException ) && ( "Broken pipe" . equals ( thr . getMessage ( ) ) || "Connection reset by peer" . equals ( thr . getMessage ( ) ) ) ) { return level ; } if ( ( thr instanceof ConnectException ) && ( "Connection timed out" . equals ( thr . getMessage ( ) ) || "Connection refused" . equals ( thr . getMessage ( ) ) ) ) { return level ; } Throwable cause = thr . getCause ( ) ; if ( cause != null ) { return brokenConnection ( level , cause ) ; } return Level . SEVERE ; }
Tries to detect if Throwable is caused by broken connection . If detected returns level else return SEVERE .