本文整理了Java中org.webpieces.util.logging.Logger.error()
方法的一些代码示例,展示了Logger.error()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.error()
方法的具体详情如下:
包路径:org.webpieces.util.logging.Logger
类名称:Logger
方法名:error
[英]Log a message at the ERROR level.
[中]在错误级别记录消息。
代码示例来源:origin: org.webpieces/core-util
@Override
public void run() {
try {
runnable.run();
} catch(Throwable e) {
log.error("Uncaught Exception", e);
} finally {
executeNext(key);
}
}
}
代码示例来源:origin: org.webpieces/core-util
public <T> T ack(T result, Throwable t) {
if(t != null) {//on exception just ack the whole thing(as all others quite possibly will not ack at all)
log.error("Exception", t);
future.complete(null);
}
int counter = countDown.decrementAndGet();
if(counter == 0) {
future.complete(null);
}
return result;
}
代码示例来源:origin: org.webpieces/core-util
@Override
public void run() {
try {
runImpl();
} catch(Throwable e) {
log.error("Exception running runnable", e);
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
@Override
public void farEndClosed(Channel channel) {
try {
dataListener.farEndClosed(channel);
} catch(Throwable e) {
log.error("Exception", e);
}
}
代码示例来源:origin: org.webpieces/http-frontend
@Override
public void applyBackPressure(Channel channel) {
log.error("Need to apply backpressure", new RuntimeException("demonstrates how we got here"));
processor.applyWriteBackPressure(channel);
}
代码示例来源:origin: org.webpieces/http-common
@Override
public void failure(Channel channel, ByteBuffer data, Exception e) {
log.error("Failure on channel="+channel, e);
// Call failure on every protocol
for(Map.Entry<Protocol, DataListener> entry: dataListenerMap.entrySet()) {
entry.getValue().failure(channel, data, e);
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
@Override
public void failure(Channel channel, ByteBuffer data, Exception e) {
try {
dataListener.failure(channel, data, e);
} catch(Throwable ee) {
log.error("Exception caught trying to handle the other exception(the other exception IS more important)", ee);
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
public void farEndClosed(Channel channel) {
try {
synchronized(this) {
if(closedAlready)
return;
closedAlready = true;
}
listener.farEndClosed(channel);
} catch (Throwable e) {
log.error("Exception", e);
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
public void failure(Channel channel, ByteBuffer data, Exception e) {
try {
listener.failure(channel, data, e);
} catch (Throwable ee) {
log.error("Exception processing other exception", ee);
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
public final void processRegistrations() {
try {
run();
future.complete(null);
} catch(Throwable e) {
log.error("Exception completing", e);
future.completeExceptionally(e);
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
@Override
public CompletableFuture<Void> incomingData(Channel channel, ByteBuffer b) {
try {
return dataListener.incomingData(channel, b);
} catch(Throwable e) {
log.error("Exception", e);
CompletableFuture<Void> fut = new CompletableFuture<Void>();
fut.completeExceptionally(e);
return fut;
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
/**
* @param fromAddr
* @param e
*/
private void fireFailure(InetSocketAddress fromAddr, ByteBuffer data, Throwable e) {
try {
listener.failure(this, fromAddr, data, e);
} catch(Throwable ee) {
log.error(id+"Exception notifying client of exception", ee);
}
}
代码示例来源:origin: org.webpieces/core-channelmanager2
public CompletableFuture<Void> incomingData(Channel channel, ByteBuffer b) {
try {
return listener.incomingData(channel, b);
} catch (Throwable e) {
log.error("Exception", e);
CompletableFuture<Void> future = new CompletableFuture<>();
future.completeExceptionally(e);
return future;
}
}
代码示例来源:origin: org.webpieces/http1_1-client
@Override
public void failure(Channel channel, ByteBuffer data, Exception e) {
log.error("Failure on channel="+channel, e);
while(!responsesToComplete.isEmpty()) {
HttpResponseListener listener = responsesToComplete.poll();
if(listener != null) {
listener.failure(e);
}
}
}
代码示例来源:origin: org.webpieces/http-frontend2
public void farEndClosed(FrontendSocketImpl socket) {
log.error("far end closed="+socket);
Http2ServerEngine engine = socket.getHttp2Engine();
engine.farEndClosed();
}
代码示例来源:origin: org.webpieces/http-frontend2
public CompletableFuture<Void> incomingData(FrontendSocketImpl socket, ByteBuffer buf) {
Memento state = socket.getHttp1_1ParseState();
int newDataSize = buf.remaining();
state = parse(socket, buf);
return processWithBackpressure(socket, newDataSize, state.getNumBytesJustParsed()).exceptionally(t -> {
log.error("Exception", t);
socket.close("Exception so closing http1.1 socket="+t.getMessage());
return null;
});
}
代码示例来源:origin: org.webpieces/http-router
public Void finalFailure(ResponseStreamer responseCb, Throwable e, RequestContext requestCtx) {
log.error("This is a final(secondary failure) trying to render the Internal Server Error Route", e);
if(portConfig == null)
portConfig = portCallback.fetchPortConfig();
ResponseProcessor processor = new ResponseProcessor(requestCtx, reverseRoutes, reverseTranslator, null, responseCb, portConfig);
processor.failureRenderingInternalServerErrorPage(e);
return null;
}
代码示例来源:origin: org.webpieces/http-common
private void preconditions() {
// If we haven't gotten the settings, let's wait a little bit because another thread
// might have the settings frame and hasn't gotten around to processing it yet.
try {
Http2EngineImpl.log.info("Waiting for settings frame to arrive");
if (!this.http2EngineImpl.settingsLatch.await(500, TimeUnit.MILLISECONDS))
throw new GoAwayError(this.http2EngineImpl.lastClosedRemoteOriginatedStream().orElse(0), Http2ErrorCode.PROTOCOL_ERROR, Http2EngineImpl.wrapperGen.emptyWrapper());
} catch (InterruptedException e) {
Http2EngineImpl.log.error("Caught exception while waiting for settings frame", e);
throw new GoAwayError(this.http2EngineImpl.lastClosedRemoteOriginatedStream().orElse(0), Http2ErrorCode.PROTOCOL_ERROR, Http2EngineImpl.wrapperGen.emptyWrapper());
}
}
代码示例来源:origin: org.webpieces/embeddablehttpproxy
public Void processError(ResponseSender responseSender, HttpRequest req, Throwable e) {
log.error("could not process req="+req+" from responseSender="+responseSender+" due to exception", e);
if(e.getCause() instanceof UnresolvedAddressException) {
HttpClientException exc = new HttpClientException("Client gave a bad address to connect to", KnownStatusCode.HTTP_404_NOTFOUND, e);
badResponse.sendServerResponse(responseSender, exc);
} else {
HttpServerException exc = new HttpServerException("Server has a bug", KnownStatusCode.HTTP_500_INTERNAL_SVR_ERROR, e);
badResponse.sendServerResponse(responseSender, exc);
}
responseSender.close();
return null;
}
代码示例来源:origin: org.webpieces/http-common
private CompletableFuture<ResponseId> actuallySendResponse(HttpResponse response, Stream stream, boolean isComplete) {
return sendHeaderFrames(responseToHeaders(response), stream)
.thenAccept(v -> {
// Don't send an empty dataframe that is not completing.
if (response.getBodyNonNull().getReadableSize() != 0 || isComplete)
sendDataFrames(response.getBodyNonNull(), isComplete, stream, false);
})
.thenApply(v -> stream.getResponseId()).exceptionally(e -> {
log.error("can't send header frames", e);
return stream.getResponseId();
});
}
内容来源于网络,如有侵权,请联系作者删除!