Closed denisbondar closed 6 months ago
I've added "status" and "cause" attributes to ErrorResponse
in the master
branch, I need to update the documentation as well. Basically, status will tell you the error-status
, and cause will give either the offending VarBind
(if error-index
is non-zero), or the request PDU itself, if error-index
is zero. If by some mistake, error-index
is not a valid index, then "cause" will just contain the integer value of error-index
.
I've updated this in the documentation now as well
If the response
error-status
field is not 0, anErrorResponse
exception is thrown, to whichpdu.errorStatus
andpdu.errorIndex
are passed. But it is impossible to get these two important values from the exception instance.The need for these values can be caused, for example, by the fact that in SNMPv1, when reaching the end of the tree, the agent passes
error-status=2
(endOfMib).If execute
getNext
in the loop, at some point you may get anErrorResponse
exception and there is no way to know the value of the error-status field.Maybe this problem can be solved differently by throwing some
EndOfMib
exception at manager (v1), because the described problem is typical for SNMPv1.