Changeset 3160

Show
Ignore:
Timestamp:
04/05/07 17:53:23 (17 years ago)
Author:
jerome
Message:

Doesn't fail anymore on strange network errors ("SubstrateUnderrunError?: 31-octet
short" received during intermittent power outages).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounters/snmp.py

    r3145 r3160  
    246246        def retrieveSNMPValues(self) : 
    247247            """Retrieves a printer's internal page counter and status via SNMP.""" 
    248             errorIndication, errorStatus, errorIndex, varBinds = \ 
     248            try : 
     249                errorIndication, errorStatus, errorIndex, varBinds = \ 
    249250                 cmdgen.CommandGenerator().getCmd(cmdgen.CommunityData("pykota", self.community, 0), \ 
    250251                                                  cmdgen.UdpTransportTarget((self.printerHostname, self.port)), \ 
     
    253254                                                  tuple([int(i) for i in hrDeviceStatusOID.split('.')]), \ 
    254255                                                  tuple([int(i) for i in hrPrinterDetectedErrorStateOID.split('.')])) 
     256            except :                                       
     257                errorIndication = "Unknown SNMP/Network error. Check your wires." 
    255258            if errorIndication :                                                   
    256259                self.parent.filter.printInfo("SNMP Error : %s" % errorIndication, "error")