changes concerning exception handling
This commit is contained in:
@ -35,12 +35,18 @@ namespace Snmp2Mysql
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SnmpGetterResultProvider res = snmpGetter.Exec();
|
try
|
||||||
foreach (SnmpGetterResult r in res)
|
{
|
||||||
{
|
SnmpGetterResultProvider res = snmpGetter.Exec();
|
||||||
Console.WriteLine("{0} {1} {2}: {3}", r.Index, r.Oid, r.Type, r.Value);
|
foreach (SnmpGetterResult r in res)
|
||||||
dc.add((int)r.Index, r.Value);
|
{
|
||||||
}
|
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);
|
mPacket = (SnmpV2Packet)mTarget.Request(mPdu, mParams);
|
||||||
}
|
}
|
||||||
catch (SnmpNetworkException e)
|
catch (SnmpException e)
|
||||||
{
|
{
|
||||||
throw new SnmpGetterException(e.Message, e);
|
throw new SnmpGetterException(e.Message, e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user