mirror of
https://github.com/evopro-ag/Sharp7Reactive.git
synced 2025-12-16 11:42:52 +00:00
Add error description to exception message when read fails
This commit is contained in:
@@ -185,7 +185,8 @@ namespace Sharp7.Rx
|
||||
if (result != 0)
|
||||
{
|
||||
await EvaluateErrorCode(result);
|
||||
throw new InvalidOperationException($"Error reading {operand}{dBNr}:{startByteAddress}->{bytesToRead}");
|
||||
var errorText = this.sharp7.ErrorText(result);
|
||||
throw new InvalidOperationException($"Error reading {operand}{dBNr}:{startByteAddress}->{bytesToRead} ({errorText})");
|
||||
}
|
||||
|
||||
var retBuffer = new byte[bytesToRead];
|
||||
|
||||
Reference in New Issue
Block a user