diff --git a/shadowsocks-csharp/Controller/ShadowsocksController.cs b/shadowsocks-csharp/Controller/ShadowsocksController.cs index 5388e39a..080390be 100755 --- a/shadowsocks-csharp/Controller/ShadowsocksController.cs +++ b/shadowsocks-csharp/Controller/ShadowsocksController.cs @@ -54,16 +54,6 @@ namespace Shadowsocks.Controller { if (Errored != null) { - // translate Microsoft language into human language - // i.e. 以一种访问权限不允许的方式做了一个访问套接字的尝试 => Port is already used - if (e is SocketException) - { - SocketException se = (SocketException)e; - if (se.SocketErrorCode == SocketError.AccessDenied) - { - e = new Exception(I18N.GetString("Port is already used"), e); - } - } Errored(this, new ErrorEventArgs(e)); } } @@ -198,6 +188,16 @@ namespace Shadowsocks.Controller } catch (Exception e) { + // translate Microsoft language into human language + // i.e. An attempt was made to access a socket in a way forbidden by its access permissions => Port already in use + if (e is SocketException) + { + SocketException se = (SocketException)e; + if (se.SocketErrorCode == SocketError.AccessDenied) + { + e = new Exception(I18N.GetString("Port already in use"), e); + } + } Logging.LogUsefulException(e); ReportError(e); } diff --git a/shadowsocks-csharp/Data/cn.txt b/shadowsocks-csharp/Data/cn.txt index ba18053c..3feaeb98 100644 --- a/shadowsocks-csharp/Data/cn.txt +++ b/shadowsocks-csharp/Data/cn.txt @@ -27,7 +27,7 @@ Cancel=取消 New server=未配置的服务器 QRCode=二维码 Shadowsocks Error: {0}=Shadowsocks 错误: {0} -Port is already used=端口已被占用 +Port already in use=端口已被占用 Illegal port number format=非法端口格式 Please add at least one server=请添加至少一个服务器 Server IP can not be blank=服务器 IP 不能为空