Commit daae9e46 authored by Pavel Vainerman's avatar Pavel Vainerman

(RTU): minor fixes (catch exceptions)

parent 6c00d237
...@@ -193,9 +193,23 @@ void RTUExchange::step() ...@@ -193,9 +193,23 @@ void RTUExchange::step()
} }
catch(...) {} catch(...) {}
poll(); try
{
poll();
}
catch( std::exception& ex )
{
mbwarn << myname << "(step): poll error: " << ex.what() << endl;
}
MBExchange::step(); try
{
MBExchange::step();
}
catch( std::exception& ex )
{
mbwarn << myname << "(step): MBExchange::step error: " << ex.what() << endl;
}
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
bool RTUExchange::poll() bool RTUExchange::poll()
...@@ -298,7 +312,7 @@ bool RTUExchange::poll() ...@@ -298,7 +312,7 @@ bool RTUExchange::poll()
<< " reg=" << ModbusRTU::dat2str(it->second->mbreg) << " reg=" << ModbusRTU::dat2str(it->second->mbreg)
<< " for sensors: "; << " for sensors: ";
print_plist(dlog()->level3(), it->second->slst); print_plist(dlog()->level3(), it->second->slst);
dlog()->level3() << " err: " << ex << endl; dlog()->level3(false) << " err: " << ex << endl;
} }
if( it == rmap->end() ) if( it == rmap->end() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment