Skip to content
Snippets Groups Projects
Commit 3407d0c0 authored by akwizgran's avatar akwizgran
Browse files

Merge branch 'protocol-state-exception' into 'master'

ProtocolStateException for client protocols

Methods that implement local actions in a client protocol (for example, accepting an invitation) can throw this exception to indicate that the action wasn't taken because the action isn't applicable to the current state. This can happen if the protocol state machine is updated by an incoming message and the user takes an action before the UI has been updated.

See merge request !368
parents 8eeaf4e3 ca8d3bab
No related branches found
No related tags found
No related merge requests found
Showing with 16 additions and 11 deletions
package org.briarproject.api.clients;
import org.briarproject.api.db.DbException;
/**
* Thrown when a database operation is attempted as part of a protocol session
* and the operation is not applicable to the current protocol state.
*/
public class ProtocolStateException extends DbException {
}
......@@ -6,5 +6,4 @@ package org.briarproject.api.db;
*/
public class ContactExistsException extends DbException {
private static final long serialVersionUID = -6658762011691502411L;
}
package org.briarproject.api.db;
/** Thrown when a database operation is attempted and the database is closed. */
/**
* Thrown when a database operation is attempted and the database is closed.
*/
public class DbClosedException extends DbException {
private static final long serialVersionUID = -3679248177625310653L;
}
......@@ -2,9 +2,8 @@ package org.briarproject.api.db;
public class DbException extends Exception {
private static final long serialVersionUID = 3706581789209939441L;
public DbException() {}
public DbException() {
}
public DbException(Throwable t) {
super(t);
......
......@@ -7,5 +7,4 @@ package org.briarproject.api.db;
*/
public class NoSuchContactException extends DbException {
private static final long serialVersionUID = -7048538231308207386L;
}
......@@ -7,5 +7,4 @@ package org.briarproject.api.db;
*/
public class NoSuchGroupException extends DbException {
private static final long serialVersionUID = -5494178507342571697L;
}
......@@ -7,5 +7,4 @@ package org.briarproject.api.db;
*/
public class NoSuchLocalAuthorException extends DbException {
private static final long serialVersionUID = 494398665376703860L;
}
......@@ -7,5 +7,4 @@ package org.briarproject.api.db;
*/
public class NoSuchMessageException extends DbException {
private static final long serialVersionUID = 9191508339698803848L;
}
......@@ -7,5 +7,4 @@ package org.briarproject.api.db;
*/
public class NoSuchTransportException extends DbException {
private static final long serialVersionUID = -6274982612759573100L;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment