Merge branch 'feature/translation' into dev
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
package de.srsoftware.umbrella.journal;
|
||||
|
||||
import static de.srsoftware.umbrella.core.ConnectionProvider.connect;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.missingFieldException;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.missingField;
|
||||
import static de.srsoftware.umbrella.journal.Constants.CONFIG_DATABASE;
|
||||
import static de.srsoftware.umbrella.messagebus.MessageBus.messageBus;
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
@@ -20,7 +20,7 @@ public class JournalModule extends BaseHandler implements EventListener {
|
||||
|
||||
public JournalModule(Configuration config){
|
||||
super();
|
||||
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingFieldException(CONFIG_DATABASE));
|
||||
var dbFile = config.get(CONFIG_DATABASE).orElseThrow(() -> missingField(CONFIG_DATABASE));
|
||||
journalDb = new SqliteDb(connect(dbFile));
|
||||
ModuleRegistry.add(this);
|
||||
messageBus().register(this);
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
package de.srsoftware.umbrella.journal;
|
||||
|
||||
import static de.srsoftware.tools.jdbc.Query.insertInto;
|
||||
import static de.srsoftware.umbrella.core.Constants.*;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.databaseException;
|
||||
import static de.srsoftware.umbrella.journal.Constants.ERROR_WRITE_EVENT;
|
||||
import static de.srsoftware.umbrella.journal.Constants.TABLE_JOURNAL;
|
||||
import static java.text.MessageFormat.format;
|
||||
|
||||
import de.srsoftware.umbrella.core.BaseDb;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
import de.srsoftware.umbrella.messagebus.events.Event;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -42,7 +43,7 @@ public class SqliteDb extends BaseDb implements JournalDb{
|
||||
try {
|
||||
db.prepareStatement(sql).execute();
|
||||
} catch (SQLException e) {
|
||||
throw databaseException(ERROR_FAILED_CREATE_TABLE,TABLE_JOURNAL);
|
||||
throw UmbrellaException.failedToCreateTable(TABLE_JOURNAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user