Skip to content

Commit 47fd016

Browse files
author
Julien Poulton
committed
Merge branch '5978-sdk-sometimes-the-user-does-not-receive-referee-fail-log' into 'master'
fix(sdk): catch Throwable instead of RuntimeException to handle them all See merge request codingame/game-engine!209
2 parents 7e8856d + a4b6c0c commit 47fd016

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

engine/core/src/main/java/com/codingame/gameengine/core/GameManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void start(InputStream is, PrintStream out) {
152152

153153
s.close();
154154

155-
} catch (RuntimeException e) {
155+
} catch (Throwable e) {
156156
dumpFail(e);
157157
s.close();
158158
throw e;
@@ -209,7 +209,7 @@ protected void execute(T player, int nbrOutputLines) {
209209

210210
player.resetInputs();
211211
newTurn = false;
212-
} catch (RuntimeException e) {
212+
} catch (Throwable e) {
213213
//Don't let the user catch game fail exceptions
214214
dumpFail(e);
215215
throw e;
@@ -262,7 +262,7 @@ private void dumpScores() {
262262
out.println(data);
263263
}
264264

265-
private void dumpFail(RuntimeException e) {
265+
private void dumpFail(Throwable e) {
266266
OutputData data = new OutputData(OutputCommand.FAIL);
267267
StringWriter sw = new StringWriter();
268268
PrintWriter pw = new PrintWriter(sw);

playground/misc/misc-3-release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The CodinGame SDK is regularly updated and improved. This document lets you know what changed in the latest releases.
44

5+
## Next Version
6+
7+
### 🐞 Bug fix
8+
9+
- Improved error handling
10+
511
## 3.4.7
612

713
### 🐞 Bug fix

0 commit comments

Comments
 (0)