Search in sources :

Example 1 with Error

use of java.lang.Error in project opensmpp by OpenSmpp.

the class TLVOctets method setValueData.

protected void setValueData(ByteBuffer buffer) throws TLVException {
    checkLength(buffer);
    if (buffer != null) {
        try {
            value = buffer.removeBuffer(buffer.length());
        } catch (NotEnoughDataInByteBufferException e) {
            throw new Error("Removing buf.length() data from ByteBuffer buf " + "reported too little data in buf, which shouldn't happen.");
        }
    } else {
        value = null;
    }
    markValueSet();
}
Also used : NotEnoughDataInByteBufferException(org.smpp.util.NotEnoughDataInByteBufferException) Error(java.lang.Error)

Example 2 with Error

use of java.lang.Error in project vespa by vespa-engine.

the class MessageBusAsyncSession method send.

/**
 * A convenience method for assigning the internal trace level and route string to a message before sending it
 * through the internal mbus session object.
 *
 * @param msg The message to send.
 * @return The document api result object.
 */
public Result send(Message msg) {
    try {
        long reqId = requestId.incrementAndGet();
        msg.setContext(reqId);
        msg.getTrace().setLevel(traceLevel);
        if (route != null) {
            return toResult(reqId, session.send(msg, route, true));
        } else {
            return toResult(reqId, session.send(msg));
        }
    } catch (Exception e) {
        return new Result(Result.ResultType.FATAL_ERROR, new Error(e.getMessage(), e));
    }
}
Also used : Error(java.lang.Error) Result(com.yahoo.documentapi.Result)

Aggregations

Error (java.lang.Error)2 Result (com.yahoo.documentapi.Result)1 NotEnoughDataInByteBufferException (org.smpp.util.NotEnoughDataInByteBufferException)1