25 lines
683 B
C#
25 lines
683 B
C#
using System;
|
|
namespace ln.snmp
|
|
{
|
|
public class SnmpError : Exception
|
|
{
|
|
public override string Message { get; }
|
|
public int Error { get; }
|
|
public int ErrorIndex { get; }
|
|
public String ObjectIdentifier { get; }
|
|
|
|
public SnmpError(int error,int errorIndex,string objectIdentifier)
|
|
{
|
|
Error = error;
|
|
ErrorIndex = errorIndex;
|
|
ObjectIdentifier = objectIdentifier;
|
|
Message = ToString();
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return String.Format("SNMP Error {0} (Index: {1} = {2}) was received",Error,ErrorIndex,ObjectIdentifier);
|
|
}
|
|
}
|
|
}
|