Skip to content

Commit

Permalink
exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Koos85 committed Sep 26, 2023
1 parent 11d7721 commit d27855c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions asyncsnmplib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class InvalidSnmpVersionException(SnmpException):


class ParseResultException(SnmpException):
message = 'Failed to parse result.'
def __init__(self, message: str):
super().__init__(message)
self.message = message


def snmpv3_credentials(config: dict):
Expand Down Expand Up @@ -117,10 +119,10 @@ async def snmp_queries(

try:
await cl.connect()
except SnmpNoConnection as e:
except SnmpNoConnection:
raise
except SnmpNoAuthParams:
logging.warning(f'unable to connect: failed to set auth params')
logging.warning('unable to connect: failed to set auth params')
raise
else:
results = {}
Expand Down

0 comments on commit d27855c

Please sign in to comment.