mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
Improve exception logging for some general exception handlers.
This commit is contained in:
committed by
Andreas Schildbach
parent
51f6b9b682
commit
3f12cfdcce
@@ -959,7 +959,7 @@ public class Peer extends PeerSocketHandler {
|
||||
// Start the operation.
|
||||
sendMessage(getdata);
|
||||
} catch (Exception e) {
|
||||
log.error("{}: Couldn't send getdata in downloadDependencies({})", this, tx.getHash());
|
||||
log.error("{}: Couldn't send getdata in downloadDependencies({})", this, tx.getHash(), e);
|
||||
resultFuture.setException(e);
|
||||
return resultFuture;
|
||||
} finally {
|
||||
|
@@ -331,7 +331,7 @@ public class TransactionOutput extends ChildMessage {
|
||||
}
|
||||
} catch (ScriptException e) {
|
||||
// Just means we didn't understand the output of this transaction: ignore it.
|
||||
log.debug("Could not parse tx output script: {}", e.toString());
|
||||
log.debug("Could not parse tx {} output script: {}", parent != null ? parent.getHash() : "(no parent)", e.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -232,7 +232,7 @@ class ConnectionHandler implements MessageWriteTarget {
|
||||
// This can happen eg if the channel closes while the thread is about to get killed
|
||||
// (ClosedByInterruptException), or if handler.connection.receiveBytes throws something
|
||||
Throwable t = Throwables.getRootCause(e);
|
||||
log.warn("Error handling SelectionKey: {}", t.getMessage() != null ? t.getMessage() : t.getClass().getName());
|
||||
log.warn("Error handling SelectionKey: {} {}", t.getClass().getName(), t.getMessage() != null ? t.getMessage() : "", e);
|
||||
handler.closeConnection();
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ public class NioClientManager extends AbstractExecutionThreadService implements
|
||||
// may cause this. Otherwise it may be any arbitrary kind of connection failure.
|
||||
// Calling sc.socket().getRemoteSocketAddress() here throws an exception, so we can only log the error itself
|
||||
Throwable cause = Throwables.getRootCause(e);
|
||||
log.warn("Failed to connect with exception: {}: {}", cause.getClass().getName(), cause.getMessage());
|
||||
log.warn("Failed to connect with exception: {}: {}", cause.getClass().getName(), cause.getMessage(), e);
|
||||
handler.closeConnection();
|
||||
data.future.setException(cause);
|
||||
data.future = null;
|
||||
|
Reference in New Issue
Block a user