Skip to content

Commit

Permalink
Added a few error checking stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Smudgge committed Jul 9, 2024
1 parent 7a792fe commit 0fce6d4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
Empty file removed config.yml
Empty file.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.kerbity</groupId>
<artifactId>Kerb</artifactId>
<version>1.9.1</version>
<version>1.9.3</version>
<build>
<plugins>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<groupId>com.github.kerbity</groupId>
<artifactId>Kerb</artifactId>
<version>1.9.1</version>
<version>1.9.3</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/github/kerbity/kerb/client/KerbClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
package com.github.kerbity.kerb.client;

import com.github.kerbity.kerb.Connection;
import com.github.kerbity.kerb.indicator.PasswordEncryption;
import com.github.kerbity.kerb.client.listener.EventListener;
import com.github.kerbity.kerb.client.listener.ObjectListener;
import com.github.kerbity.kerb.client.listener.PriorityEventListener;
import com.github.kerbity.kerb.client.registeredclient.RegisteredClient;
import com.github.kerbity.kerb.indicator.PasswordEncryption;
import com.github.kerbity.kerb.packet.Packet;
import com.github.kerbity.kerb.packet.PacketType;
import com.github.kerbity.kerb.packet.event.Event;
Expand Down Expand Up @@ -339,6 +339,12 @@ public int getReconnectAttempts() {
// Complete the result collection.
resultCollection.complete(CompleteReason.TIME);

// Log a warn message.
this.logger.warn(
"Result took too long to complete and was therefor cancelled. " +
"You may want to increase the max wait time. sequence=" + sequenceIdentifier
);

// Remove the result collection from the map.
this.removeResult(sequenceIdentifier);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ public void interpret(@NotNull Packet packet) {

try {
// Attempt to add the result.
Integer integer = Integer.parseInt(packet.getData());
int integer = Integer.parseInt(packet.getData());

if (this.client.getDebugMode()) this.client.getLogger().log("Client amount : " + integer);

// Add the result.
resultCollection.addResult(integer);
Expand All @@ -88,6 +90,7 @@ public void interpret(@NotNull Packet packet) {

} catch (Exception exception) {
this.client.getLogger().warn("Unable to convert packet data to a integer. packet=" + packet);
this.client.getLogger().warn("Data=" + packet.getData());
throw new RuntimeException(exception);
}

Expand Down

0 comments on commit 0fce6d4

Please sign in to comment.