Code cleanup
This commit is contained in:
@ -416,7 +416,8 @@ public class BitmessageContext {
|
||||
customCommandHandler = new CustomCommandHandler() {
|
||||
@Override
|
||||
public MessagePayload handle(CustomMessage request) {
|
||||
throw new RuntimeException("Received custom request, but no custom command handler configured.");
|
||||
throw new IllegalStateException(
|
||||
"Received custom request, but no custom command handler configured.");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
package ch.dissem.bitmessage.entity.payload;
|
||||
|
||||
import ch.dissem.bitmessage.entity.Streamable;
|
||||
import ch.dissem.bitmessage.exception.ApplicationException;
|
||||
import ch.dissem.bitmessage.exception.DecryptionFailedException;
|
||||
import ch.dissem.bitmessage.utils.*;
|
||||
import org.slf4j.Logger;
|
||||
@ -123,7 +124,7 @@ public class CryptoBox implements Streamable {
|
||||
writeWithoutMAC(macData);
|
||||
return security().mac(key_m, macData.toByteArray());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new ApplicationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
package ch.dissem.bitmessage.utils;
|
||||
|
||||
import ch.dissem.bitmessage.exception.AddressFormatException;
|
||||
import ch.dissem.bitmessage.exception.ApplicationException;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
@ -83,7 +84,7 @@ public class Base58 {
|
||||
try {
|
||||
return new String(output, "US-ASCII");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException(e); // Cannot happen.
|
||||
throw new ApplicationException(e); // Cannot happen.
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user