Improve robustness of connection

This commit is contained in:
Peter Butzhammer
2024-04-26 09:59:43 +02:00
parent f5a51c074f
commit e52c81683b
2 changed files with 59 additions and 88 deletions

View File

@@ -213,7 +213,7 @@ internal class Sharp7Connector : IS7Connector
private void EnsureConnectionValid()
{
if (disposed)
throw new ObjectDisposedException("S7Connector");
throw new ObjectDisposedException(nameof(Sharp7Connector));
if (sharp7 == null)
throw new InvalidOperationException("S7 driver is not initialized.");