Adding special exception for database

This commit is contained in:
Molzonas 2025-08-30 20:38:43 +02:00
parent 9280402032
commit 1ce7188931
2 changed files with 21 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import fr.molzonas.mzcore.database.provider.MZDatabaseProvider;
import fr.molzonas.mzcore.database.provider.MZDatabaseProviderMariaDB; import fr.molzonas.mzcore.database.provider.MZDatabaseProviderMariaDB;
import fr.molzonas.mzcore.database.provider.MZDatabaseProviderPostgreSQL; import fr.molzonas.mzcore.database.provider.MZDatabaseProviderPostgreSQL;
import fr.molzonas.mzcore.database.provider.MZDatabaseProviderSQLite; import fr.molzonas.mzcore.database.provider.MZDatabaseProviderSQLite;
import fr.molzonas.mzcore.exception.MZDatabaseException;
import org.flywaydb.core.Flyway; import org.flywaydb.core.Flyway;
import org.jooq.SQLDialect; import org.jooq.SQLDialect;
import org.jooq.codegen.GenerationTool; import org.jooq.codegen.GenerationTool;
@ -36,7 +37,7 @@ public final class MZCodegen {
try { try {
GenerationTool.generate(buildJooqConfiguration(config, provider, targetFolder, targetPackage)); GenerationTool.generate(buildJooqConfiguration(config, provider, targetFolder, targetPackage));
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("jOOQ codegen failed", e); throw new MZDatabaseException("jOOQ codegen failed", e);
} }
} }

View File

@ -0,0 +1,19 @@
package fr.molzonas.mzcore.exception;
public class MZDatabaseException extends RuntimeException {
public MZDatabaseException(String message) {
super(message);
}
public MZDatabaseException(Exception e) {
super(e);
}
public MZDatabaseException(Throwable t) {
super(t);
}
public MZDatabaseException(String message, Throwable t) {
super(message, t);
}
public MZDatabaseException(String message, Exception e) {
super(message, e);
}
}