@@ -258,7 +258,7 @@ private static void generateAssetsFile(Path tmpdir, String assetsPath) {
258
258
if (!fonts .contains (new JsonPrimitive (newName ))) {
259
259
fonts .add (newName );
260
260
}
261
-
261
+
262
262
Files .write (
263
263
tmpdir .resolve ("hashed_assets" ).resolve (newName ),
264
264
newContent .getBytes (),
@@ -284,6 +284,9 @@ private static void generateAssetsFile(Path tmpdir, String assetsPath) {
284
284
);
285
285
}
286
286
}
287
+ } catch (JsonSyntaxException e ) {
288
+ log .error ("Invalid JSON in file " + f .getFileName () + " at " + f .toString ().replaceAll ("^" + tmpdir .toString (), "" ));
289
+ e .printStackTrace ();
287
290
} catch (IOException e ) {
288
291
e .printStackTrace ();
289
292
}
@@ -526,8 +529,8 @@ private void checkQuestionsTypeValidity(GameConfig gameConfig, QuestionConfig qu
526
529
throw new MissingConfigException ("An optimization game must have a sorting_order property in config.ini." );
527
530
} else if (!"ASC" .equalsIgnoreCase (questionConfig .getSortingOrder ())
528
531
&& !"DESC" .equalsIgnoreCase (questionConfig .getSortingOrder ())) {
529
- throw new MissingConfigException ("The sorting order for an optimization game must be ASC (ascendant) or DESC (descendant)" );
530
- }
532
+ throw new MissingConfigException ("The sorting order for an optimization game must be ASC (ascendant) or DESC (descendant)" );
533
+ }
531
534
}
532
535
533
536
switch (gameConfig .getGameType ()) {
@@ -679,7 +682,8 @@ public void handleRequest(HttpServerExchange exchange) throws Exception {
679
682
}
680
683
681
684
exchange .setStatusCode (StatusCodes .OK );
682
- } if (exchange .getRelativePath ().equals ("/stub" )) {
685
+ }
686
+ if (exchange .getRelativePath ().equals ("/stub" )) {
683
687
File stubFile = sourceFolderPath .resolve ("config/stub.txt" ).toFile ();
684
688
if (exchange .getRequestMethod ().equalToString ("GET" )) {
685
689
String stub = FileUtils .readFileToString (stubFile , StandardCharsets .UTF_8 );
0 commit comments