Skip to content

Commit

Permalink
show some more information on std error when training fails
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Feb 13, 2024
1 parent 82aa588 commit 223d543
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected void run(Bootstrap<GrobidQuantitiesConfiguration> 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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 223d543

Please sign in to comment.