From 735008eb99b93c7cb660cff9a39b1ee4b23ae626 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 11 Oct 2015 16:56:01 +0000 Subject: [PATCH] // unexpected error => dump stack --- source/net/filebot/Main.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/Main.java b/source/net/filebot/Main.java index 1cf8cecf..35c0eca1 100644 --- a/source/net/filebot/Main.java +++ b/source/net/filebot/Main.java @@ -64,6 +64,7 @@ import net.filebot.web.CachedResource; import net.miginfocom.swing.MigLayout; import net.sf.ehcache.CacheManager; +import org.kohsuke.args4j.CmdLineException; import org.w3c.dom.NodeList; public class Main { @@ -209,10 +210,14 @@ public class Main { Logger.getLogger(Main.class.getName()).log(Level.WARNING, "Failed to show Getting Started help", e); } } - } catch (Exception e) { - // illegal arguments => just print CLI error message and stop + } catch (CmdLineException e) { + // illegal arguments => print CLI error message System.err.println(e.getMessage()); System.exit(-1); + } catch (Throwable e) { + // unexpected error => dump stack + e.printStackTrace(); + System.exit(-1); } }