Clean up some catch statements

This commit is contained in:
Bond_009
2018-12-20 13:39:58 +01:00
parent ea4c914123
commit 79d18cf5a5
14 changed files with 56 additions and 63 deletions

View File

@@ -2214,7 +2214,7 @@ namespace Emby.Server.Implementations
}
catch (Exception ex)
{
Logger.LogDebug("Ping test result to {0}. Success: {1} {2}", apiUrl, false, ex.Message);
Logger.LogDebug(ex, "Ping test result to {0}. Success: {1}", apiUrl, false);
_validAddressResults.AddOrUpdate(apiUrl, false, (k, v) => false);
return false;

View File

@@ -619,7 +619,7 @@ namespace Emby.Server.Implementations.Dto
}
catch (Exception ex)
{
_logger.LogError(ex, "Error getting person {0}", c);
_logger.LogError(ex, "Error getting person {Name}", c);
return null;
}

View File

@@ -166,6 +166,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
_logger.LogError(ex, "Error");
return;
}

View File

@@ -89,7 +89,7 @@ namespace SharpCifs
{
Runtime.GetBytesForString(string.Empty, DefaultOemEncoding);
}
catch (Exception ex)
catch (Exception)
{
if (_log.Level >= 2)
{

View File

@@ -153,7 +153,7 @@ namespace SharpCifs.Dcerpc
DcerpcMessage bind = new DcerpcBind(Binding, this);
Sendrecv(bind);
}
catch (IOException ioe)
catch (IOException)
{
State = 0;
throw;

View File

@@ -130,7 +130,7 @@ namespace SharpCifs.Netbios
{
name = Runtime.GetStringForBytes(tmp, 0, length).Trim();
}
catch (Exception ex)
catch (Exception)
{
}

View File

@@ -117,8 +117,9 @@ namespace SharpCifs.Netbios
{
Baddr = Config.GetInetAddress("jcifs.netbios.baddr", Extensions.GetAddressByName("255.255.255.255"));
}
catch (Exception ex)
catch (Exception)
{
}
_sndBuf = new byte[SndBufSize];
@@ -302,7 +303,10 @@ namespace SharpCifs.Netbios
}
}
catch (TimeoutException) { }
catch (TimeoutException)
{
}
catch (Exception ex)
{
if (_log.Level > 2)

View File

@@ -192,7 +192,7 @@ namespace SharpCifs.Smb
catch (Exception e)
{
throw new SmbException(e.Message, e);
}
}
}
default: