Skip to content

Commit

Permalink
Revert improvement to TransactionNotFound cause message since
Browse files Browse the repository at this point in the history
Canton still outputs the old message and assertions fail.
  • Loading branch information
tudor-da committed Oct 20, 2021
1 parent 2a796ba commit 34a5fac
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ object LedgerApiErrors extends LedgerApiErrorGroup {
) {

case class Reject(transactionId: String)(implicit loggingContext: ContextualizedErrorLogger)
extends LoggingTransactionErrorImpl(cause = "Transaction not found or not visible.") {
extends LoggingTransactionErrorImpl(cause = "Transaction not found, or not visible.") {
override def resources: Seq[(ErrorResource, String)] = Seq(
(ErrorResource.TransactionId, transactionId)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ErrorFactories private (errorCodesVersionSwitcher: ErrorCodesVersionSwitch
Status
.newBuilder()
.setCode(Code.NOT_FOUND.value())
.setMessage("Transaction not found or not visible.")
.setMessage("Transaction not found, or not visible.")
.build()
),
v2 = LedgerApiErrors.ReadErrors.TransactionNotFound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ class ErrorFactoriesSpec extends AnyWordSpec with Matchers with TableDrivenPrope
ErrorDetails.ErrorInfoDetail("PACKAGE_NOT_FOUND"),
DefaultTraceIdRequestInfo,
ErrorDetails.ResourceInfoDetail("PACKAGE", "packageId123"),
)
),
)
}

"return a transactionNotFound error" in {
assertVersionedError(_.transactionNotFound(Ref.TransactionId.assertFromString("tId")))(
v1_code = Code.NOT_FOUND,
v1_message = "Transaction not found or not visible.",
v1_message = "Transaction not found, or not visible.",
v1_details = Seq.empty,
v2_code = Code.NOT_FOUND,
v2_message =
s"TRANSACTION_NOT_FOUND(11,$correlationId): Transaction not found or not visible.",
s"TRANSACTION_NOT_FOUND(11,$correlationId): Transaction not found, or not visible.",
v2_details = Seq[ErrorDetails.ErrorDetail](
ErrorDetails.ErrorInfoDetail("TRANSACTION_NOT_FOUND"),
DefaultTraceIdRequestInfo,
Expand Down Expand Up @@ -353,6 +353,10 @@ class ErrorFactoriesSpec extends AnyWordSpec with Matchers with TableDrivenPrope
v2_code = Code.INVALID_ARGUMENT,
v2_message =
s"INVALID_ARGUMENT(8,$correlationId): The submitted command has invalid arguments: my message",
v2_details = Seq[ErrorDetails.ErrorDetail](
ErrorDetails.ErrorInfoDetail("INVALID_ARGUMENT"),
DefaultTraceIdRequestInfo,
),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class ParticipantPruningIT extends LedgerTestSuite {
)
} yield {
prunedTransactionTrees.foreach(
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found or not visible."))
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found, or not visible."))
)
}
})
Expand Down Expand Up @@ -326,7 +326,7 @@ class ParticipantPruningIT extends LedgerTestSuite {
)
} yield {
prunedFlatTransactions.foreach(
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found or not visible."))
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found, or not visible."))
)
}
})
Expand Down Expand Up @@ -365,7 +365,7 @@ class ParticipantPruningIT extends LedgerTestSuite {
_ <- Future.sequence(unprunedEventIds.map(participant.transactionTreeByEventId(_, submitter)))
} yield {
prunedEventsViaTree.foreach(
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found or not visible."))
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found, or not visible."))
)
}
})
Expand Down Expand Up @@ -404,7 +404,7 @@ class ParticipantPruningIT extends LedgerTestSuite {
_ <- Future.sequence(unprunedEventIds.map(participant.flatTransactionByEventId(_, submitter)))
} yield {
prunedEventsViaFlat.foreach(
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found or not visible."))
assertGrpcError(_, Status.Code.NOT_FOUND, Some("Transaction not found, or not visible."))
)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand All @@ -60,7 +60,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand Down Expand Up @@ -94,7 +94,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand All @@ -112,7 +112,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand Down Expand Up @@ -148,7 +148,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand All @@ -166,7 +166,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand Down Expand Up @@ -202,7 +202,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand All @@ -220,7 +220,7 @@ class TransactionServiceQueryIT extends LedgerTestSuite {
assertGrpcError(
failure,
Status.Code.NOT_FOUND,
Some("Transaction not found or not visible."),
Some("Transaction not found, or not visible."),
)
}
})
Expand Down

0 comments on commit 34a5fac

Please sign in to comment.