Throws an exception only from the run method

This commit is contained in:
Marcin Grzejszczak
2019-05-07 15:24:16 +02:00
parent 091b8bba8b
commit 05f911e0ae

View File

@@ -41,11 +41,16 @@ public class ReleaserApplication implements CommandLineRunner {
Parser parser;
public static void main(String[] args) {
SpringApplication application = new SpringApplication(ReleaserApplication.class);
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);
}
@Override
public void run(String... strings) {
Options options = this.parser.parse(strings);
try {
SpringApplication application = new SpringApplication(
ReleaserApplication.class);
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);
this.releaser.release(options);
}
catch (MakeBuildUnstableException ex) {
log.error(
@@ -60,19 +65,6 @@ public class ReleaserApplication implements CommandLineRunner {
log.error("Exception occurred for the releaser", th);
throw th;
}
}
@Override
public void run(String... strings) {
Options options = this.parser.parse(strings);
try {
this.releaser.release(options);
}
catch (Throwable e) {
log.error("Exception occurred for the releaser. Picked options were ["
+ options + "]");
throw e;
}
System.exit(0);
}