Skip to content

Commit 14a2298

Browse files
committed
No more stack traces.
1 parent a67b898 commit 14a2298

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

src/main/java/io/github/techstreet/dfscript/features/AuthHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static void regen() {
8383
DFScript.MC.getSessionService().joinServer(session.getProfile(), session.getAccessToken(), commonSecret);
8484
} catch (AuthenticationException e) {
8585
DFScript.LOGGER.error(e.getMessage());
86-
e.printStackTrace();
86+
// e.printStackTrace();
8787
}
8888

8989
// Authorization step two - Generate the authcode
@@ -118,7 +118,7 @@ public static void regen() {
118118
DFScript.LOGGER.info("Server authorization code successfully generated!");
119119
}
120120
} catch (Exception e) {
121-
e.printStackTrace();
121+
// e.printStackTrace();
122122
}
123123

124124
try {
@@ -140,7 +140,7 @@ public static void regen() {
140140
staff = false;
141141
}
142142
} catch (Exception e) {
143-
e.printStackTrace();
143+
// e.printStackTrace();
144144
}
145145
}
146146

src/main/java/io/github/techstreet/dfscript/screen/script/ScriptAddScreen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static void getScripts() {
8787
}
8888
} catch (Exception e) {
8989
AuthHandler.regen();
90-
e.printStackTrace();
90+
// e.printStackTrace();
9191
}
9292

9393
try {
@@ -113,7 +113,7 @@ public static void getScripts() {
113113

114114
ScriptAddScreen.scripts = scripts;
115115
} catch (Exception e) {
116-
e.printStackTrace();
116+
// e.printStackTrace();
117117
}
118118
}
119119

src/main/java/io/github/techstreet/dfscript/screen/script/ScriptInstallScreen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ public static void setApproved(VirtualScript script, boolean approved) {
101101
if (e.getMessage().contains("403")) {
102102
DFScript.MC.setScreen(new ScriptMessageScreen(new ScriptInstallScreen(script), "You don't have permission to " + (!approved ? "un" : "") + "approve this script!"));
103103
} else {
104-
e.printStackTrace();
104+
// e.printStackTrace();
105105
}
106106
}
107107
} catch (Exception e) {
108-
e.printStackTrace();
108+
// e.printStackTrace();
109109
}
110110
}
111111

src/main/java/io/github/techstreet/dfscript/screen/script/ScriptListScreen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public boolean mouseClicked(double x, double y, int button) {
160160
}
161161
} catch (Exception e) {
162162
DFScript.MC.setScreen(new ScriptMessageScreen(new ScriptListScreen(allowEditAndUpload), "Failed to upload script to the server, please report this to a DFScript developer!"));
163-
e.printStackTrace();
163+
// e.printStackTrace();
164164
}
165165
}, 0, 0, 1, 0.5f, 0, 0.5f);
166166

@@ -194,12 +194,12 @@ public boolean mouseClicked(double x, double y, int button) {
194194
if (e.getMessage().contains("401")) {
195195
DFScript.MC.setScreen(new ScriptMessageScreen(new ScriptListScreen(allowEditAndUpload), "You don't have permission to delete this script!"));
196196
} else {
197-
e.printStackTrace();
197+
// e.printStackTrace();
198198
}
199199
}
200200
} catch (Exception e) {
201201
DFScript.MC.setScreen(new ScriptMessageScreen(new ScriptListScreen(allowEditAndUpload), "Failed to remove the script from the server, please try again!"));
202-
e.printStackTrace();
202+
// e.printStackTrace();
203203
}
204204
}, 0, 0, 1, 0.5f, 0, 0.5f);
205205
}

src/main/java/io/github/techstreet/dfscript/script/ScriptManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private void loadScript(File file) {
172172
LOGGER.info("Loaded script: " + file.getName());
173173
} catch (Exception e) {
174174
LOGGER.error("Failed to load script: " + file.getName());
175-
e.printStackTrace();
175+
// e.printStackTrace();
176176
}
177177
}
178178

@@ -181,7 +181,7 @@ public void saveScript(Script script) {
181181
FileUtil.writeFile(script.getFile().toPath(), GSON.toJson(script));
182182
} catch (Exception e) {
183183
LOGGER.error("Failed to save script: " + script.getFile().getName());
184-
e.printStackTrace();
184+
// e.printStackTrace();
185185
}
186186
}
187187

@@ -232,7 +232,7 @@ public void createScript(String name) {
232232
file = FileUtil.folder("Scripts").resolve(name + ".json").toFile();
233233
} catch (InvalidPathException e) {
234234
LOGGER.error("Failed to save script: " + script.getFile().getName());
235-
e.printStackTrace();
235+
// e.printStackTrace();
236236
}
237237

238238
script.setFile(file);

src/main/java/io/github/techstreet/dfscript/script/VirtualScript.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void download(boolean update) {
7878
Files.write(file.toPath(), content.getBytes());
7979
DFScript.MC.setScreen(new ScriptMessageScreen(new ScriptListScreen(true), "Successfully installed '" + name + "' by " + owner + "!"));
8080
} catch (Exception e) {
81-
e.printStackTrace();
81+
// e.printStackTrace();
8282
}
8383
}
8484
}

src/main/java/io/github/techstreet/dfscript/script/action/ScriptActionType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ public enum ScriptActionType {
13721372
ScriptValue value = ScriptValueJson.fromJson(json);
13731373
ctx.context().setVariable(ctx.variable("Result").name(), value);
13741374
} catch (IOException e) {
1375-
e.printStackTrace();
1375+
// e.printStackTrace();
13761376
ChatUtil.error("Internal error while reading file.");
13771377
}
13781378
}
@@ -1397,7 +1397,7 @@ public enum ScriptActionType {
13971397
f.toFile().getParentFile().mkdirs();
13981398
FileUtil.writeFile(f, ScriptValueJson.toJson(value).toString());
13991399
} catch (IOException e) {
1400-
e.printStackTrace();
1400+
// e.printStackTrace();
14011401
ChatUtil.error("Internal error while writing file.");
14021402
}
14031403
} else {

src/main/java/io/github/techstreet/dfscript/util/VersionUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static int getLatestVersion() {
1212
JsonObject jsonObject = JsonParser.parseString(webContent).getAsJsonObject();
1313
return Integer.parseInt(jsonObject.get("name").getAsString().substring(6));
1414
} catch (IOException e) {
15-
e.printStackTrace();
15+
// e.printStackTrace();
1616
}
1717
return 0;
1818
}

0 commit comments

Comments
 (0)