changes concerning exception handling
This commit is contained in:
parent
ac2d5cccb9
commit
4df6273c95
@ -35,12 +35,18 @@ namespace Snmp2Mysql
|
||||
}
|
||||
}
|
||||
|
||||
SnmpGetterResultProvider res = snmpGetter.Exec();
|
||||
foreach (SnmpGetterResult r in res)
|
||||
{
|
||||
Console.WriteLine("{0} {1} {2}: {3}", r.Index, r.Oid, r.Type, r.Value);
|
||||
dc.add((int)r.Index, r.Value);
|
||||
}
|
||||
try
|
||||
{
|
||||
SnmpGetterResultProvider res = snmpGetter.Exec();
|
||||
foreach (SnmpGetterResult r in res)
|
||||
{
|
||||
Console.WriteLine("{0} {1} {2}: {3}", r.Index, r.Oid, r.Type, r.Value);
|
||||
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