dcapwell commented on code in PR #101:
URL: https://github.com/apache/cassandra-accord/pull/101#discussion_r1664556043
##########
accord-core/src/main/java/accord/coordinate/CoordinationFailed.java:
##########
@@ -61,4 +70,21 @@ void set(TxnId txnId, RoutingKey homeKey)
{
return homeKey;
}
+
+ /**
+ * Wrap the exception without changing the type so asynchronous callbacks
can add their own stack
+ */
+ public CoordinationFailed wrap()
+ {
+ checkState(this.getClass() == CoordinationFailed.class);
+ return new CoordinationFailed(txnId, homeKey, this);
+ }
+
+ public static Throwable wrap(Throwable t)
+ {
+ if (t instanceof CoordinationFailed)
Review Comment:
not safe... we almost never use `CoordinationFailed` directly, we use an
extending type... so the type check will match many things, then `wrap()` will
fail as we *require* the top level class to be `CoordinationFailed` (which is
almost never true)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]