Skip to content

Commit

Permalink
comment out catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgio Trettenero committed Dec 4, 2024
1 parent c75b3ad commit ae6f57f
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ public void delete(final ConnectorRequestContext context, final QualifiedName na
try {
this.polarisStoreService.deleteDatabase(name.getDatabaseName());
} catch (DataIntegrityViolationException exception) {
if (exception.getMessage().contains("violates foreign key constraint")
|| (exception.getCause() instanceof SQLException
&& "23503".equals(((SQLException) exception.getCause()).getSQLState()))) {

final String errorMessage = String.format(
"Failed to delete database %s due to foreign key constraint violation. "
+ "Ensure all dependent tables are removed first. Error: %s",
name, exception.getMessage()
);
throw new DatabasePreconditionFailedException(name, errorMessage, exception);
}
// if (exception.getMessage().contains("violates foreign key constraint")
// || (exception.getCause() instanceof SQLException
// && "23503".equals(((SQLException) exception.getCause()).getSQLState()))) {
//
// final String errorMessage = String.format(
// "Failed to delete database %s due to foreign key constraint violation. "
// + "Ensure all dependent tables are removed first. Error: %s",
// name, exception.getMessage()
// );
// throw new DatabasePreconditionFailedException(name, errorMessage, exception);
// }
throw new InvalidMetaException(name, exception);
} catch (Exception exception) {
throw new ConnectorException(
Expand Down

0 comments on commit ae6f57f

Please sign in to comment.