Default to logging warnings when the websocket has an error
import java.io.Closeable;
import java.util.function.Consumer;
+import java.util.logging.Logger;
+
+import static java.util.logging.Level.WARNING;
public interface WebSocket extends Closeable {
+ Logger LOG = Logger.getLogger(WebSocket.class.getName());
+
WebSocket send(Message message);
default WebSocket sendText(CharSequence data) {
@@ -60,7 +65,7 @@ default void onText(CharSequence data) {
}
default void onError(Throwable cause) {
- // Does nothing
+ LOG.log(WARNING, cause.getMessage(), cause);
}
}
