3 import dolda.dolcon.protocol.Response;
5 public class ResponseException extends ProtocolException {
9 public ResponseException(Response resp, int expected) {
10 super("Unhandled DC protocol response (" + resp.code + " != " + expected + ")");
12 this.expected = expected;
15 public ResponseException(String msg, Response resp, int expected) {
18 this.expected = expected;
21 public static Response check(Response resp, int expect) throws ResponseException {
22 if(resp.code != expect)
23 throw(new ResponseException(resp, expect));