From: David ‘Bombe’ Roden Date: Sun, 9 Jan 2011 20:13:42 +0000 (+0100) Subject: Catch exceptions in the whole startup sequence. X-Git-Tag: 0.3.7^2~8^2~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=dcfdd6ec7075169cce6ff3560c7b79629c7a46ff;p=Sone.git Catch exceptions in the whole startup sequence. --- diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 68c9d90..219f989 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -166,28 +166,28 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 } } - /* create freenet interface. */ - FreenetInterface freenetInterface = new FreenetInterface(pluginRespirator.getNode()); + boolean startupFailed = true; + try { + /* create freenet interface. */ + FreenetInterface freenetInterface = new FreenetInterface(pluginRespirator.getNode()); - /* create web of trust connector. */ - PluginConnector pluginConnector = new PluginConnector(pluginRespirator); - WebOfTrustConnector webOfTrustConnector = new WebOfTrustConnector(pluginConnector); - identityManager = new IdentityManager(webOfTrustConnector); - identityManager.setContext("Sone"); + /* create web of trust connector. */ + PluginConnector pluginConnector = new PluginConnector(pluginRespirator); + WebOfTrustConnector webOfTrustConnector = new WebOfTrustConnector(pluginConnector); + identityManager = new IdentityManager(webOfTrustConnector); + identityManager.setContext("Sone"); - /* create core. */ - core = new Core(oldConfiguration, freenetInterface, identityManager); + /* create core. */ + core = new Core(oldConfiguration, freenetInterface, identityManager); - /* create the web interface. */ - webInterface = new WebInterface(this); - core.addCoreListener(webInterface); + /* create the web interface. */ + webInterface = new WebInterface(this); + core.addCoreListener(webInterface); - /* create the identity manager. */ - identityManager.addIdentityListener(core); + /* create the identity manager. */ + identityManager.addIdentityListener(core); - /* start core! */ - boolean startupFailed = true; - try { + /* start core! */ core.start(); if ((newConfiguration != null) && (oldConfiguration != newConfiguration)) { logger.log(Level.INFO, "Setting configuration to file-based configuration.");