Lalant commented on code in PR #7482:
URL: https://github.com/apache/ignite-3/pull/7482#discussion_r2917630711
##########
modules/transactions/src/main/java/org/apache/ignite/internal/tx/TxStateMeta.java:
##########
@@ -187,10 +281,52 @@ public TxState txState() {
return isFinishedDueToTimeout;
}
+ public boolean isFinishedDueToTimeoutOrFalse() {
+ return Boolean.TRUE.equals(isFinishedDueToTimeout);
+ }
+
public @Nullable String txLabel() {
return txLabel;
}
+ public @Nullable Throwable lastException() {
+ return lastException;
+ }
+
+ public @Nullable Integer lastExceptionErrorCode() {
+ return lastExceptionErrorCode;
+ }
+
+ private static @Nullable Throwable normalizeThrowable(@Nullable Throwable
throwable) {
+ return throwable == null ? null :
ExceptionUtils.unwrapRootCause(throwable);
+ }
+
+ private static @Nullable Integer normalizeErrorCode(
+ @Nullable Integer explicitErrorCode,
+ @Nullable Throwable throwable,
+ @Nullable Boolean isFinishedDueToTimeout
+ ) {
+ if (Boolean.TRUE.equals(isFinishedDueToTimeout)) {
+ return null;
+ }
+
+ if (explicitErrorCode != null) {
+ return explicitErrorCode;
+ }
+
+ Throwable normalized = normalizeThrowable(throwable);
Review Comment:
I removed this method, it was used twice/
--
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]