From 223d543bb8b56a9e59bc51a7ba3d835e464632c9 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Wed, 14 Feb 2024 07:33:17 +0900 Subject: [PATCH] show some more information on std error when training fails --- .../service/command/PrepareDelftTrainingCommand.java | 2 +- .../grobid/service/command/TrainingGenerationCommand.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/grobid/service/command/PrepareDelftTrainingCommand.java b/src/main/java/org/grobid/service/command/PrepareDelftTrainingCommand.java index fd3ed989..3a7f322b 100644 --- a/src/main/java/org/grobid/service/command/PrepareDelftTrainingCommand.java +++ b/src/main/java/org/grobid/service/command/PrepareDelftTrainingCommand.java @@ -90,7 +90,7 @@ protected void run(Bootstrap bootstrap, Namespace LibraryLoader.load(); } catch (final Exception exp) { System.err.println("Grobid initialisation failed, cannot find Grobid Home. Maybe you forget to specify the config.yml in the command launch?"); - exp.printStackTrace(); + System.err.println("Grobid initialisation error. " + exp); System.exit(-1); } diff --git a/src/main/java/org/grobid/service/command/TrainingGenerationCommand.java b/src/main/java/org/grobid/service/command/TrainingGenerationCommand.java index 9cccf2d3..0fe4f5df 100644 --- a/src/main/java/org/grobid/service/command/TrainingGenerationCommand.java +++ b/src/main/java/org/grobid/service/command/TrainingGenerationCommand.java @@ -68,7 +68,7 @@ public void configure(Subparser subparser) { } @Override - protected void run(Bootstrap bootstrap, Namespace namespace, GrobidQuantitiesConfiguration configuration) throws Exception { + protected void run(Bootstrap bootstrap, Namespace namespace, GrobidQuantitiesConfiguration configuration) throws Exception { File grobidHomeOverride = namespace.get(GROBID_HOME_DIRECTORY); initGrobidHome(configuration.getGrobidHome(), grobidHomeOverride); @@ -90,14 +90,14 @@ public static String initGrobidHome(String grobidHomeFromConfig, File grobidHome grobidHomeFinder = new GrobidHomeFinder(Collections.singletonList(grobidHomeFromConfig)); } GrobidProperties.getInstance(grobidHomeFinder); - + Engine.getEngine(true); LibraryLoader.load(); return GrobidProperties.getGrobidHome().getAbsolutePath(); - + } catch (final Exception exp) { System.err.println("Grobid initialisation failed. Maybe you forget to specify the location of the config.yml in the command launch as final argument?"); - LOGGER.debug("Grobid initialisation error. ", exp); + System.err.println("Grobid initialisation error. " + exp); System.exit(-1); }