Generally add the exception as second argument when logging errors.

Add check for null pointer when unregistering XML-RPC handler.
This commit is contained in:
hns 2005-03-21 17:46:39 +00:00
parent 60b61d63ca
commit 335f351c5c

View file

@ -95,7 +95,7 @@ public class ApplicationManager implements XmlRpcHandler {
} }
} }
} catch (Exception mx) { } catch (Exception mx) {
server.getLogger().error("Error checking applications: " + mx); server.getLogger().error("Error checking applications", mx);
} }
lastModified = System.currentTimeMillis(); lastModified = System.currentTimeMillis();
@ -159,7 +159,7 @@ public class ApplicationManager implements XmlRpcHandler {
lastModified = System.currentTimeMillis(); lastModified = System.currentTimeMillis();
} catch (Exception mx) { } catch (Exception mx) {
server.getLogger().error("Error starting applications: " + mx); server.getLogger().error("Error starting applications", mx);
mx.printStackTrace(); mx.printStackTrace();
} }
} }
@ -397,7 +397,7 @@ public class ApplicationManager implements XmlRpcHandler {
app.start(); app.start();
} catch (Exception x) { } catch (Exception x) {
server.getLogger().error("Error creating application " + appName + ": " + x); server.getLogger().error("Error creating application " + appName, x);
x.printStackTrace(); x.printStackTrace();
} }
} }
@ -413,7 +413,7 @@ public class ApplicationManager implements XmlRpcHandler {
app.stop(); app.stop();
server.getLogger().info("Stopped application " + appName); server.getLogger().info("Stopped application " + appName);
} catch (Exception x) { } catch (Exception x) {
server.getLogger().error("Couldn't stop app: " + x); server.getLogger().error("Couldn't stop app", x);
} }
descriptors.remove(appName); descriptors.remove(appName);
@ -514,7 +514,7 @@ public class ApplicationManager implements XmlRpcHandler {
xmlrpcHandlers.put(xmlrpcHandlerName, app); xmlrpcHandlers.put(xmlrpcHandlerName, app);
// app.start(); // app.start();
} catch (Exception x) { } catch (Exception x) {
server.getLogger().error("Couldn't bind app: " + x); server.getLogger().error("Couldn't bind app", x);
x.printStackTrace(); x.printStackTrace();
} }
} }
@ -548,9 +548,11 @@ public class ApplicationManager implements XmlRpcHandler {
} }
// unregister as XML-RPC handler // unregister as XML-RPC handler
if (xmlrpcHandlerName != null) {
xmlrpcHandlers.remove(xmlrpcHandlerName); xmlrpcHandlers.remove(xmlrpcHandlerName);
}
} catch (Exception x) { } catch (Exception x) {
server.getLogger().error("Couldn't unbind app: " + x); server.getLogger().error("Couldn't unbind app", x);
} }
} }