Example usage for io.netty.util.internal.logging InternalLogger warn

List of usage examples for io.netty.util.internal.logging InternalLogger warn

Introduction

In this page you can find the example usage for io.netty.util.internal.logging InternalLogger warn.

Prototype

void warn(String msg, Throwable t);

Source Link

Document

Log an exception (throwable) at the WARN level with an accompanying message.

Usage

From source file:kr.pe.codda.server.task.ToLetterCarrier.java

License:Apache License

public static void putInputErrorMessageToOutputMessageQueue(SelfExn.ErrorType errorType, String errorReason,
        int mailboxID, int mailID, String messageID, AcceptedConnection fromAcceptedConnection,
        MessageProtocolIF messageProtocol) throws InterruptedException {

    if (null == errorType) {
        throw new IllegalArgumentException("the parameter errorType is null");
    }//from w  ww  .ja  v a 2s  .c om

    if (null == errorReason) {
        throw new IllegalArgumentException("the parameter errorReason is null");
    }

    if (null == fromAcceptedConnection) {
        throw new IllegalArgumentException("the parameter fromSocketResource is null");
    }

    if (null == messageProtocol) {
        throw new IllegalArgumentException("the parameter messageProtocol is null");
    }

    SelfExnRes selfExnRes = buildSelfExn(mailboxID, mailID, messageID, errorType, errorReason);

    ArrayDeque<WrapBuffer> wrapBufferListOfSelfExn = null;
    try {
        wrapBufferListOfSelfExn = messageProtocol.M2S(selfExnRes, CommonStaticFinalVars.SELFEXN_ENCODER);

    } catch (Exception e) {
        InternalLogger log = InternalLoggerFactory.getInstance(ToLetterCarrier.class);
        String errorMessage = new StringBuilder()
                .append("fail to build a output stream of the output message SelfExnRes[")
                .append(selfExnRes.toString()).append("] to send to from-client[")
                .append(fromAcceptedConnection.toSimpleInfomation())
                .append("] because of unknown error, errmsg=").append(e.getMessage()).toString();
        log.warn(errorMessage, e);
        return;
    }

    fromAcceptedConnection.addOutputMessage(selfExnRes, wrapBufferListOfSelfExn);
}