Try not to replace OperationCanceledException with PlcException.

This commit is contained in:
Serge Camille
2020-09-06 14:16:53 +02:00
parent 4da76c7f6d
commit faea428e4c

View File

@@ -268,6 +268,10 @@ namespace S7.Net
{
throw new PlcException(ErrorCode.ReadData, socketException);
}
catch (OperationCanceledException)
{
throw;
}
catch (Exception exc)
{
throw new PlcException(ErrorCode.ReadData, exc);
@@ -484,6 +488,10 @@ namespace S7.Net
throw new PlcException(ErrorCode.WrongNumberReceivedBytes);
}
}
catch (OperationCanceledException)
{
throw;
}
catch (Exception exc)
{
throw new PlcException(ErrorCode.WriteData, exc);
@@ -506,6 +514,10 @@ namespace S7.Net
throw new PlcException(ErrorCode.WrongNumberReceivedBytes);
}
}
catch (OperationCanceledException)
{
throw;
}
catch (Exception exc)
{
throw new PlcException(ErrorCode.WriteData, exc);