working on translation of system messages

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-12-10 08:46:05 +01:00
parent 30add879ad
commit a4f08e13a6
4 changed files with 14 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ import static de.srsoftware.tools.jdbc.Query.insertInto;
import static de.srsoftware.tools.jdbc.Query.select;
import static de.srsoftware.umbrella.contact.Constants.*;
import static de.srsoftware.umbrella.core.Constants.*;
import static de.srsoftware.umbrella.core.Errors.FAILED_TO_LOAD_CONTACTS_OF_USER;
import static de.srsoftware.umbrella.core.Errors.FAILED_TO_LOAD_CONTACT_BY_ID;
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.databaseException;
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.notFound;
import static java.text.MessageFormat.format;
@@ -94,9 +96,9 @@ public class SqliteDb extends BaseDb implements ContactDb{
if (rs.next()) contact = Contact.of(rs);
rs.close();
if (contact != null) return contact;
throw notFound("Failed to load contact with id = {0}", contactId);
throw notFound(FAILED_TO_LOAD_CONTACT_BY_ID, contactId);
} catch (SQLException e) {
throw databaseException("Failed to load contacts of user {0}",userId);
throw databaseException(FAILED_TO_LOAD_CONTACTS_OF_USER,userId);
}
}