RockteMQ-AI commented on code in PR #2752:
URL:
https://github.com/apache/rocketmq-dashboard/pull/2752#discussion_r3886179933
##########
server/src/main/java/org/apache/rocketmq/studio/instance/InstanceService.java:
##########
@@ -541,6 +550,26 @@ private String instanceAuditDetail(InstanceVO instance) {
return "name=" + instance.getName() + ", vendor=" + vendor + ", type="
+ instance.getType();
}
+ private boolean isCloudCredentialReferenceViolation(Throwable exception) {
+ Throwable current = exception;
+ while (current != null) {
+ String message = current.getMessage();
+ if (message != null) {
+ String lower = message.toLowerCase(Locale.ROOT);
+ boolean foreignKeyFailure = lower.contains("foreign key")
+ || lower.contains("referential integrity");
+ boolean credentialReference = lower.contains("credential_id")
+ || lower.contains("rmq_cloud_credential");
+ if (lower.contains("fk_instance_cloud_credential")
Review Comment:
The exception-message string matching in
`isCloudCredentialReferenceViolation` is pragmatic for the current MySQL/H2
stack, but worth noting that error messages can vary across DB versions and
engines. Consider adding a unit test that exercises this method with
representative exception chains from each supported database, so regressions in
the matching logic are caught early.
--
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]