Skip to content

Commit ee806ad

Browse files
committed
chore(cg sdk): better error log when output capacity reached
1 parent 3057835 commit ee806ad

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)