Skip to content

Commit cb09dde

Browse files
committed
Added automatic error reporting
1 parent b7a452b commit cb09dde

128 files changed

Lines changed: 708 additions & 247 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,6 @@ CoreProtect-TestAPI
224224
!/src/main/java/net/coreprotect/utility/extensions/Extensions.java
225225
/.apt_generated/
226226
/.apt_generated_tests/
227+
228+
# Server side files
229+
server/*

src/main/java/net/coreprotect/CoreProtectAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import net.coreprotect.listener.player.InventoryChangeListener;
4444
import net.coreprotect.utility.Chat;
4545
import net.coreprotect.utility.MaterialUtils;
46+
import net.coreprotect.utility.ErrorReporter;
4647

4748
/**
4849
* The main API class for CoreProtect.
@@ -1095,7 +1096,7 @@ else if (argBlock instanceof EntityType && !addedEntity) {
10951096
}
10961097
}
10971098
catch (Exception e) {
1098-
e.printStackTrace();
1099+
ErrorReporter.report(e);
10991100
}
11001101

11011102
return result;

src/main/java/net/coreprotect/api/BlockAPI.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import net.coreprotect.utility.BlockUtils;
2020
import net.coreprotect.utility.StringUtils;
2121
import net.coreprotect.utility.WorldUtils;
22+
import net.coreprotect.utility.ErrorReporter;
2223

2324
/**
2425
* Provides API methods for block-related lookups in the CoreProtect database.
@@ -97,7 +98,7 @@ public static List<String[]> performLookup(Block block, int offset) {
9798
}
9899
}
99100
catch (Exception e) {
100-
e.printStackTrace();
101+
ErrorReporter.report(e);
101102
}
102103

103104
return result;
@@ -177,7 +178,7 @@ public static List<BlockResult> performLookup(Block block, LookupOptions options
177178
}
178179
}
179180
catch (Exception e) {
180-
e.printStackTrace();
181+
ErrorReporter.report(e);
181182
}
182183

183184
return result;
@@ -244,7 +245,7 @@ public static List<ContainerResult> performContainerLookup(LookupOptions options
244245
}
245246
}
246247
catch (Exception e) {
247-
e.printStackTrace();
248+
ErrorReporter.report(e);
248249
}
249250

250251
return result;

src/main/java/net/coreprotect/api/InventoryAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import net.coreprotect.database.Database;
1313
import net.coreprotect.database.statement.UserStatement;
1414
import net.coreprotect.utility.WorldUtils;
15+
import net.coreprotect.utility.ErrorReporter;
1516

1617
/**
1718
* Provides API methods for normalized player inventory transaction lookups.
@@ -65,7 +66,7 @@ public static List<InventoryResult> performLookup(LookupOptions options) {
6566
}
6667
}
6768
catch (Exception e) {
68-
e.printStackTrace();
69+
ErrorReporter.report(e);
6970
}
7071

7172
return result;

src/main/java/net/coreprotect/api/ItemAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.coreprotect.database.logger.ItemLogger;
1414
import net.coreprotect.database.statement.UserStatement;
1515
import net.coreprotect.utility.WorldUtils;
16+
import net.coreprotect.utility.ErrorReporter;
1617

1718
/**
1819
* Provides API methods for world item transaction lookups.
@@ -66,7 +67,7 @@ public static List<ItemResult> performLookup(LookupOptions options) {
6667
}
6768
}
6869
catch (Exception e) {
69-
e.printStackTrace();
70+
ErrorReporter.report(e);
7071
}
7172

7273
return result;

src/main/java/net/coreprotect/api/MessageAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import net.coreprotect.database.Database;
1313
import net.coreprotect.database.statement.UserStatement;
1414
import net.coreprotect.utility.WorldUtils;
15+
import net.coreprotect.utility.ErrorReporter;
1516

1617
/**
1718
* Provides API methods for player chat and command lookups.
@@ -74,7 +75,7 @@ private static List<MessageResult> performLookup(String table, CoreProtectAction
7475
}
7576
}
7677
catch (Exception e) {
77-
e.printStackTrace();
78+
ErrorReporter.report(e);
7879
}
7980

8081
return result;

src/main/java/net/coreprotect/api/QueueLookup.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import net.coreprotect.utility.MaterialUtils;
1818
import net.coreprotect.utility.StringUtils;
1919
import net.coreprotect.utility.WorldUtils;
20+
import net.coreprotect.utility.ErrorReporter;
2021

2122
/**
2223
* Provides API methods for looking up block-related actions in the processing queue.
@@ -103,7 +104,7 @@ public static List<String[]> performLookup(Block block) {
103104
Collections.reverse(result);
104105
}
105106
catch (Exception e) {
106-
e.printStackTrace();
107+
ErrorReporter.report(e);
107108
}
108109

109110
return result;

src/main/java/net/coreprotect/api/SessionLookup.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.coreprotect.database.Database;
1515
import net.coreprotect.database.statement.UserStatement;
1616
import net.coreprotect.utility.WorldUtils;
17+
import net.coreprotect.utility.ErrorReporter;
1718

1819
/**
1920
* Provides API methods for looking up player session data in the CoreProtect database.
@@ -81,7 +82,7 @@ public static List<String[]> performLookup(String user, int offset) {
8182
}
8283
}
8384
catch (Exception e) {
84-
e.printStackTrace();
85+
ErrorReporter.report(e);
8586
}
8687

8788
return result;
@@ -131,7 +132,7 @@ public static List<SessionResult> performLookup(LookupOptions options) {
131132
}
132133
}
133134
catch (Exception e) {
134-
e.printStackTrace();
135+
ErrorReporter.report(e);
135136
}
136137

137138
return result;

src/main/java/net/coreprotect/api/SignAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import net.coreprotect.database.statement.UserStatement;
1616
import net.coreprotect.model.action.SignActions;
1717
import net.coreprotect.utility.WorldUtils;
18+
import net.coreprotect.utility.ErrorReporter;
1819

1920
/**
2021
* Provides API methods for sign text lookups.
@@ -71,7 +72,7 @@ public static List<SignResult> performLookup(LookupOptions options) {
7172
}
7273
}
7374
catch (Exception e) {
74-
e.printStackTrace();
75+
ErrorReporter.report(e);
7576
}
7677

7778
return result;

src/main/java/net/coreprotect/api/UsernameAPI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.coreprotect.config.Config;
1414
import net.coreprotect.config.ConfigHandler;
1515
import net.coreprotect.database.Database;
16+
import net.coreprotect.utility.ErrorReporter;
1617

1718
/**
1819
* Provides API methods for username history lookups.
@@ -80,7 +81,7 @@ public static List<UsernameResult> performLookup(LookupOptions options) {
8081
}
8182
}
8283
catch (Exception e) {
83-
e.printStackTrace();
84+
ErrorReporter.report(e);
8485
}
8586

8687
return result;

0 commit comments

Comments
 (0)