Example usage for com.google.common.util.concurrent UncheckedTimeoutException getMessage

List of usage examples for com.google.common.util.concurrent UncheckedTimeoutException getMessage

Introduction

In this page you can find the example usage for com.google.common.util.concurrent UncheckedTimeoutException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.obiba.mica.search.rest.UncheckedTimeoutExceptionMapper.java

@Override
protected GeneratedMessage.ExtendableMessage<?> getErrorDto(UncheckedTimeoutException e) {
    return ErrorDtos.ClientErrorDto.newBuilder().setCode(getStatus().getStatusCode())
            .setMessageTemplate("server.error.search.timeout").setMessage(e.getMessage()).build();
}

From source file:net.i2cat.netconf.NetconfSession.java

public Reply sendSyncQuery(IQuery query) throws TransportException {

    log.info("Sending query (" + query.getOperation().getName() + ")");

    query.setMessageId(generateMessageId());
    // validate(query);
    log.debug("--------------------------------------------------");
    log.debug("sending QUERY");
    log.debug(query.toXML());//ww w . j a  va2s.c  om
    log.debug("--------------------------------------------------");

    transport.sendAsyncQuery(query.getRpcElement());

    log.info("Sent. Waiting for response...");
    Reply reply = null;
    try {
        if (sessionContext.containsKey(SessionContext.TIMEOUT)) {
            reply = (Reply) messageQueue.blockingConsumeById(query.getMessageId(), sessionContext.getTimeout());
        } else {
            reply = (Reply) messageQueue.blockingConsumeById(query.getMessageId());
        }
    } catch (UncheckedTimeoutException e) {
        throw new TransportException("Timeout while waiting for reply to query.", e);
    } catch (Exception e) {
        throw new TransportException("Error getting reply to query: " + e.getMessage(), e);
    }
    log.debug("--------------------------------------------------");
    log.debug("receiving REPLY ");
    log.debug(reply.getContain());
    log.debug("--------------------------------------------------");

    log.info("Reply received");

    return reply;
}