debug("getHandlers","\tV1: Throwing exception");
// The index in the exception must correspond to the
// SNMP index ...
//
final SnmpStatusException sse =
new SnmpStatusException(x, index + 1);
sse.initCause(x);
throw sse;
} else if ((type == SnmpDefinitions.pduWalkRequest) ||
(type == SnmpDefinitions.pduSetRequestPdu)) {
final int status =
SnmpRequestTree.mapSetException(x.getStatus(),ver);
if (isDebugOn())
debug("getHandlers","\tSET: Throwing exception");
final SnmpStatusException sse =
new SnmpStatusException(status, index + 1);
sse.initCause(x);
throw sse;
} else if (atomic) {
// Should never come here...
if (isDebugOn())
debug("getHandlers","\tATOMIC: Throwing exception");
final SnmpStatusException sse =
new SnmpStatusException(x, index + 1);
sse.initCause(x);
throw sse;
}
final int status =
SnmpRequestTree.mapGetException(x.getStatus(),ver);
if (status == SnmpStatusException.noSuchInstance) {
if (isDebugOn())
debug("getHandlers",
"\tGET: Registering noSuchInstance");
var.value= SnmpVarBind.noSuchInstance;
} else if (status == SnmpStatusException.noSuchObject) {
if (isDebugOn())
debug("getHandlers",
"\tGET: Registering noSuchObject");
var.value= SnmpVarBind.noSuchObject;
} else {
if (isDebugOn())
debug("getHandlers",
"\tGET: Registering global error: "
+ status);
final SnmpStatusException sse =
new SnmpStatusException(status, index + 1);
sse.initCause(x);
throw sse;
}
}
}
return handlers;