From a316b95f454e089e9c7a4be1af8c9e053fdbcd18 Mon Sep 17 00:00:00 2001 From: Raif Atef Date: Sat, 26 Aug 2017 21:22:53 +0200 Subject: [PATCH] Logging for SIP003 start failure. --- .../Controller/ShadowsocksController.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/shadowsocks-csharp/Controller/ShadowsocksController.cs b/shadowsocks-csharp/Controller/ShadowsocksController.cs index 9b27a700e..39c482115 100644 --- a/shadowsocks-csharp/Controller/ShadowsocksController.cs +++ b/shadowsocks-csharp/Controller/ShadowsocksController.cs @@ -158,10 +158,18 @@ public EndPoint GetPluginLocalEndPointIfConfigured(Server server) return null; } - if (plugin.StartIfNeeded()) + try + { + if (plugin.StartIfNeeded()) + { + Logging.Info( + $"Started SIP003 plugin for {server.Identifier()} on {plugin.LocalEndPoint} - PID: {plugin.ProcessId}"); + } + } + catch (Exception ex) { - Logging.Info( - $"Started SIP003 plugin for {server.Identifier()} on {plugin.LocalEndPoint} - PID: {plugin.ProcessId}"); + Logging.Error("Failed to start SIP003 plugin: " + ex.Message); + throw; } return plugin.LocalEndPoint;