mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
DatabaseComponent throws an exception instead of returning silently if a contact is removed during an operation involving that contact. More unit tests.
This commit is contained in:
@@ -21,7 +21,6 @@ public interface DatabaseComponent {
|
||||
static final long MAX_BYTES_BETWEEN_SPACE_CHECKS = 5L * MEGABYTES;
|
||||
static final long MAX_MS_BETWEEN_SPACE_CHECKS = 60L * 1000L; // 1 min
|
||||
static final long BYTES_PER_SWEEP = 5L * MEGABYTES;
|
||||
static final int RETRANSMIT_THRESHOLD = 3;
|
||||
|
||||
/**
|
||||
* Opens the database.
|
||||
|
||||
@@ -4,6 +4,10 @@ public class DbException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 3706581789209939441L;
|
||||
|
||||
public DbException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public DbException(Throwable t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
14
api/net/sf/briar/api/db/NoSuchContactException.java
Normal file
14
api/net/sf/briar/api/db/NoSuchContactException.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package net.sf.briar.api.db;
|
||||
|
||||
/**
|
||||
* Thrown when a database operation is attempted for a contact that is not in
|
||||
* the database.
|
||||
*/
|
||||
public class NoSuchContactException extends DbException {
|
||||
|
||||
private static final long serialVersionUID = -7048538231308207386L;
|
||||
|
||||
public NoSuchContactException() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user