1# 2# This file is part of pysnmp software. 3# 4# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> 5# License: http://snmplabs.com/pysnmp/license.html 6# 7 8import sys 9 10 11class PySnmpError(Exception): 12 def __init__(self, *args): 13 msg = args and str(args[0]) or '' 14 15 self.cause = sys.exc_info() 16 17 if self.cause[0]: 18 msg += 'caused by %s: %s' % (self.cause[0], self.cause[1]) 19 20 if msg: 21 args = (msg,) + args[1:] 22 23 Exception.__init__(self, *args) 24