changes concerning exception handling
This commit is contained in:
parent
ac2d5cccb9
commit
4df6273c95
@ -35,6 +35,8 @@ namespace Snmp2Mysql
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
SnmpGetterResultProvider res = snmpGetter.Exec();
|
||||
foreach (SnmpGetterResult r in res)
|
||||
{
|
||||
@ -42,6 +44,10 @@ namespace Snmp2Mysql
|
||||
dc.add((int)r.Index, r.Value);
|
||||
}
|
||||
}
|
||||
catch (SnmpGetterException e) {
|
||||
Console.WriteLine ("no result: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ namespace Snmp2Mysql
|
||||
{
|
||||
mPacket = (SnmpV2Packet)mTarget.Request(mPdu, mParams);
|
||||
}
|
||||
catch (SnmpNetworkException e)
|
||||
catch (SnmpException e)
|
||||
{
|
||||
throw new SnmpGetterException(e.Message, e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user