Skip to content

Commit

Permalink
suppress more irrelevant errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xspanger3770 committed Nov 11, 2023
1 parent 13adc46 commit 53e623e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
Expand Down Expand Up @@ -104,6 +101,9 @@ private void checkReconnect() {
private void sendQuakeRequest() {
try {
sendPacket(new EarthquakesRequestPacket());
} catch(SocketTimeoutException | SocketException e){
Logger.trace(e);
onClose();
} catch (IOException e) {
Logger.error(e);
onClose();
Expand All @@ -113,6 +113,9 @@ private void sendQuakeRequest() {
private void sendHeartbeat() {
try {
sendPacket(new HeartbeatPacket());
} catch(SocketTimeoutException | SocketException e){
Logger.trace(e);
onClose();
} catch (IOException e) {
Logger.error(e);
onClose();
Expand All @@ -124,8 +127,12 @@ private void onClose() {
if(socket != null){
try {
socket.close();
} catch(SocketTimeoutException | SocketException e){
Logger.trace(e);
onClose();
} catch (IOException e) {
Logger.error(e);
onClose();
}
}

Expand All @@ -144,7 +151,7 @@ private void runReader() {
Packet packet = (Packet) inputStream.readObject();
((GlobalQuakeClient) GlobalQuakeClient.instance).processPacket(this, packet);
}
} catch(SocketTimeoutException se){
} catch(SocketTimeoutException | SocketException se){
Logger.trace(se);
}catch (Exception e){
Logger.error(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void sendIntensityData() {
if (!data.isEmpty()) {
broadcast(getStationReceivingClients(), new StationsIntensityPacket(GlobalQuake.instance.getStationManager().getIndexing(), System.currentTimeMillis(), data));
}
}catch(Exception e){
} catch(Exception e){
Logger.error(e);
}
}
Expand Down Expand Up @@ -256,7 +256,9 @@ private void broadcast(List<ServerClient> clients, Packet packet) {
clients.forEach(client -> {
try {
client.sendPacket(packet);
} catch (IOException e) {
} catch(SocketException | SocketTimeoutException e){
Logger.trace(e);
}catch (IOException e) {
Logger.trace(e);
}
});
Expand Down

0 comments on commit 53e623e

Please sign in to comment.