Catch exception that arises due to a change in code. Shouldn't be an issue (#18863)

This commit is contained in:
IceS2 2024-11-30 17:26:49 +01:00 committed by GitHub
parent 9b9509f4b9
commit e9186dc577
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,7 @@ import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import lombok.extern.slf4j.Slf4j;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.statement.UnableToExecuteStatementException;
import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChart;
import org.openmetadata.schema.dataInsight.custom.LineChart;
import org.openmetadata.schema.dataInsight.custom.LineChartMetric;
@ -148,6 +149,9 @@ public class MigrationUtil {
appRepository.deleteByName("admin", "DataInsightsApplication", true, true);
} catch (EntityNotFoundException ex) {
LOG.debug("DataInsights Application not found.");
} catch (UnableToExecuteStatementException ex) {
// Note: Due to a change in the code this delete fails on a postDelete step that is not
LOG.debug("[UnableToExecuteStatementException]: {}", ex.getMessage());
}
// Update DataInsightsApplication MarketplaceDefinition - It will be recreated on AppStart
@ -158,6 +162,9 @@ public class MigrationUtil {
marketPlaceRepository.deleteByName("admin", "DataInsightsApplication", true, true);
} catch (EntityNotFoundException ex) {
LOG.debug("DataInsights Application Marketplace Definition not found.");
} catch (UnableToExecuteStatementException ex) {
// Note: Due to a change in the code this delete fails on a postDelete step that is not
LOG.debug("[UnableToExecuteStatementException]: {}", ex.getMessage());
}
}