Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set handler dies when throwing an exception #14

Open
hosthvo opened this issue Apr 29, 2016 · 0 comments
Open

Set handler dies when throwing an exception #14

hosthvo opened this issue Apr 29, 2016 · 0 comments

Comments

@hosthvo
Copy link
Owner

hosthvo commented Apr 29, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant