code: public static void logIfUnexpected(Logger logger, Channel ch,
                                         @Nullable SessionProtocol protocol, Throwable cause) {
          if (!logger.isWarnEnabled() || isExpected(cause)) {
              return;
          }
  
          logger.warn("{}[{}] Unexpected exception:",
                      ch, protocolName(protocol), cause);
      }
docs: Logs the specified exception if it is {@linkplain #isExpected(Throwable) unexpected}.