working on backend-side translations
This commit is contained in:
@@ -7,8 +7,7 @@ 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.Errors.*;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.databaseException;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.notFound;
|
||||
import static java.text.MessageFormat.format;
|
||||
@@ -68,7 +67,7 @@ public class SqliteDb extends BaseDb implements ContactDb{
|
||||
Query.delete().from(TABLE_CONTACTS_USERS).where(CONTACT_ID,equal(contact.id())).execute(db);
|
||||
db.setAutoCommit(true);
|
||||
} catch (SQLException e){
|
||||
throw databaseException("Failed to remove contact {0}",contact.id());
|
||||
throw databaseException(FAILED_TO_DROP_ENTITY,"contact",contact.id());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +95,7 @@ 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_BY_ID, contactId);
|
||||
throw notFound(FAILED_TO_LOAD_ENTITY_BY_ID, "contact", contactId);
|
||||
} catch (SQLException e) {
|
||||
throw databaseException(FAILED_TO_LOAD_CONTACTS_OF_USER,userId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user