Feature ETP-1917: replace OBException with local DBSMException in DBSMOBUtil#12
Feature ETP-1917: replace OBException with local DBSMException in DBSMOBUtil#12RomanMagnoli wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a dedicated DBSMException for database schema management utilities and switches DBSMOBUtil to throw it instead of the generic OBException for SSL/certificate validation and unpooled connection failures, improving error specificity within the DBSM/DDLUtils layer.
Changes:
- Added
org.openbravo.ddlutils.util.DBSMException(runtime exception) for DBSM-related failures. - Updated
DBSMOBUtil#getUnpooledConnection()to throwDBSMExceptionfor SSL root certificate validation errors and SQL connection failures. - Removed the unused
OBExceptionimport fromDBSMOBUtil.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/org/openbravo/ddlutils/util/DBSMOBUtil.java |
Replaces OBException throws with DBSMException in SSL/connection error paths and removes the unused import. |
src/org/openbravo/ddlutils/util/DBSMException.java |
Adds a local runtime exception type for DBSM utility-layer failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2065ec9 to
7cb8348
Compare
|
| * </p> | ||
| */ | ||
| public class DBSMException extends RuntimeException { | ||
|
|
There was a problem hiding this comment.
Suggestion
Consider adding the default constructor and the constructor that accepts a Throwable cause.
public class DBSMException extends RuntimeException {
public DBSMException() {
super();
}
public DBSMException(Throwable cause) {
super(cause);
}Rationale: Adding the default constructor and the constructor that accepts only a Throwable is a best practice for custom exceptions, allowing for greater flexibility when wrapping other exceptions without needing a custom message.

0 New Issues
0 Fixed Issues
0 Accepted Issues
This pull request introduces a new custom exception class,
DBSMException, and updates the database utility code to use this exception instead of the more genericOBExceptionwhen handling SSL certificate-related errors and connection failures. This change improves error specificity and clarity in the DDLUtils utility layer.Exception handling improvements:
DBSMException, inDBSMException.javato provide more specific error reporting for database schema management operations.DBSMOBUtilclass to throwDBSMExceptioninstead ofOBExceptionfor SSL root certificate validation errors and unpooled connection failures, resulting in clearer and more consistent error handling in these scenarios. [1] [2]Code cleanup:
OBExceptionfromDBSMOBUtil.javasince it is no longer referenced in the file.