ln.snmp/SnmpError.cs

25 lines
683 B
C#
Raw Permalink Normal View History

2019-03-04 12:06:45 +01:00
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);
}
}
}