diff --git a/src/main/java/bisq/common/proto/ProtobufferException.java b/src/main/java/bisq/common/proto/ProtobufferException.java index 590e76a..a89e865 100644 --- a/src/main/java/bisq/common/proto/ProtobufferException.java +++ b/src/main/java/bisq/common/proto/ProtobufferException.java @@ -17,7 +17,9 @@ package bisq.common.proto; -public class ProtobufferException extends RuntimeException { +import java.io.IOException; + +public class ProtobufferException extends IOException { public ProtobufferException(String message) { super(message); } diff --git a/src/main/java/bisq/common/proto/ProtobufferRuntimeException.java b/src/main/java/bisq/common/proto/ProtobufferRuntimeException.java new file mode 100644 index 0000000..019ca90 --- /dev/null +++ b/src/main/java/bisq/common/proto/ProtobufferRuntimeException.java @@ -0,0 +1,28 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.common.proto; + +public class ProtobufferRuntimeException extends RuntimeException { + public ProtobufferRuntimeException(String message) { + super(message); + } + + public ProtobufferRuntimeException(String message, Throwable e) { + super(message, e); + } +} diff --git a/src/main/java/bisq/common/proto/network/NetworkProtoResolver.java b/src/main/java/bisq/common/proto/network/NetworkProtoResolver.java index c22b160..74836c3 100644 --- a/src/main/java/bisq/common/proto/network/NetworkProtoResolver.java +++ b/src/main/java/bisq/common/proto/network/NetworkProtoResolver.java @@ -18,11 +18,12 @@ package bisq.common.proto.network; import bisq.common.proto.ProtoResolver; +import bisq.common.proto.ProtobufferException; import io.bisq.generated.protobuffer.PB; public interface NetworkProtoResolver extends ProtoResolver { - NetworkEnvelope fromProto(PB.NetworkEnvelope proto); + NetworkEnvelope fromProto(PB.NetworkEnvelope proto) throws ProtobufferException; NetworkPayload fromProto(PB.StoragePayload proto);