Skip to content

Commit 4df53e7

Browse files
committed
Merge branch 'chore-better-error-log-in-sdk' into 'master'
[CHORE][CG SDK] better error log when output capacity reached See merge request codingame/game-engine!316
2 parents 3057835 + ee806ad commit 4df53e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

runner/src/main/java/com/codingame/gameengine/runner/GameRunner.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ private Command readCommand(Agent agent, int round) {
331331
}
332332
if (checkOutput(output, nbLinesToRead) != OutputResult.OK) {
333333
throw new RuntimeException(
334-
"Error reading Referee command. Buffer capacity: " + output.length() + " / "
335-
+ (round == 0 ? RefereeAgent.REFEREE_MAX_BUFFER_SIZE_EXTRA : RefereeAgent.REFEREE_MAX_BUFFER_SIZE)
334+
String.format(
335+
"Error reading Referee %s command. Buffer capacity: %d / %d",
336+
command, output.length(), (round == 0 ? RefereeAgent.REFEREE_MAX_BUFFER_SIZE_EXTRA : RefereeAgent.REFEREE_MAX_BUFFER_SIZE)
337+
)
336338
);
337339
}
338340
return new Command(InputCommand.valueOf(command), output);

0 commit comments

Comments
 (0)