Skip to content

Set handler dies when throwing an exception #14

@hosthvo

Description

@hosthvo

In sethander.py, method network_test(..)

def network_test(self, session_id, transaction_id, oid, data):
    tid = "%s_%s" % (session_id, transaction_id)
    if tid in self.transactions:
        del(self.transactions[tid])
    try:
        self.test(oid, data)
        self.transactions[tid] = oid, data
    except SetHandler as e:
        logger.error('TestSet failed')
        raise e

The line
except SetHandler as e:

Is catching SetHandler which doesn't extend from BaseException is not allowed. I think this method was intended to catch SetHandlerError. With catching SetHander, the the module will fail with:
"catching classes that do not inherit from BaseException is not allowed"
as oppose to returning a pyagentx.ERROR_WRONGVALUE back to snmpd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions