X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Flauncher%2FMain.java;h=7feaaa4cee28563aa0cdb945e6f99bd1e39d7b03;hb=aa5b4ad473f730a6d780cef9387a79c41ddf47a9;hp=6d552febfae8c16955cde0ad95480f32ef5bdc40;hpb=d459d7e12a3398344e021b1b12c94a8d647cb6c4;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/launcher/Main.java b/src/be/nikiroo/jvcard/launcher/Main.java index 6d552fe..7feaaa4 100644 --- a/src/be/nikiroo/jvcard/launcher/Main.java +++ b/src/be/nikiroo/jvcard/launcher/Main.java @@ -15,6 +15,7 @@ import be.nikiroo.jvcard.Contact; import be.nikiroo.jvcard.Data; import be.nikiroo.jvcard.TypeInfo; import be.nikiroo.jvcard.launcher.CardResult.MergeCallback; +import be.nikiroo.jvcard.launcher.Optional.NotSupportedException; import be.nikiroo.jvcard.parsers.Format; import be.nikiroo.jvcard.remote.Command; import be.nikiroo.jvcard.remote.SimpleSocket; @@ -37,7 +38,7 @@ import be.nikiroo.jvcard.resources.enums.StringId; */ public class Main { static public final String APPLICATION_TITLE = "jVcard"; - static public final String APPLICATION_VERSION = "1.0-dev"; + static public final String APPLICATION_VERSION = "1.1-dev"; static private final int ERR_NO_FILE = 1; static private final int ERR_SYNTAX = 2; @@ -286,12 +287,12 @@ public class Main { case SERVER: { try { Optional.runServer(port); - } catch (Exception e) { - if (e instanceof IOException) { - ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, - ERR_INTERNAL); - return; - } else if (e instanceof ClassNotFoundException) { + } catch (IOException e) { + ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, + ERR_INTERNAL); + return; + } catch (NotSupportedException e) { + if (!e.isCompiledIn()) { ERR(StringId.CLI_ERR, StringId.CLI_ERR_NO_REMOTING, ERR_INTERNAL); return; @@ -392,12 +393,12 @@ public class Main { case CONTACT_MANAGER: { try { Optional.startTui(textMode, files); - } catch (Exception e) { - if (e instanceof IOException) { - ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, - ERR_NO_FILE); - return; - } else if (e instanceof ClassNotFoundException) { + } catch (IOException e) { + ERR(StringId.CLI_ERR, StringId.CLI_ERR_CANNOT_START, + ERR_NO_FILE); + return; + } catch (NotSupportedException e) { + if (!e.isCompiledIn()) { ERR(StringId.CLI_ERR, StringId.CLI_ERR_NO_TUI, ERR_INTERNAL); return; } else { @@ -499,7 +500,7 @@ public class Main { } } catch (IOException ioe) { throw ioe; - } catch (Exception e) { + } catch (NotSupportedException e) { throw new IOException("Remoting support not available", e); }